mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-20 20:22:10 +00:00
updated version.txt
This commit is contained in:
1 parent
af21756a56
commit
765351fd97
131 files changed
+2
-70307
No files matched your search
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,259 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.client;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ClientPlayerBaseSorter
|
||||
{
|
||||
public ClientPlayerBaseSorter(List<String> list, Map<String, String[]> allBaseSuperiors, Map<String, String[]> allBaseInferiors, String methodName)
|
||||
{
|
||||
this.list = list;
|
||||
this.allBaseSuperiors = allBaseSuperiors;
|
||||
this.allBaseInferiors = allBaseInferiors;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void Sort()
|
||||
{
|
||||
if(list.size() <= 1)
|
||||
return;
|
||||
|
||||
if(explicitInferiors != null)
|
||||
explicitInferiors.clear();
|
||||
|
||||
if(explicitSuperiors != null)
|
||||
explicitSuperiors.clear();
|
||||
|
||||
if(directInferiorsMap != null)
|
||||
directInferiorsMap.clear();
|
||||
|
||||
if(allInferiors != null)
|
||||
allInferiors.clear();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
{
|
||||
String baseId = list.get(i);
|
||||
|
||||
String[] inferiorNames = allBaseInferiors.get(baseId);
|
||||
boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0;
|
||||
|
||||
String[] superiorNames = allBaseSuperiors.get(baseId);
|
||||
boolean hasSuperiors = superiorNames != null && superiorNames.length > 0;
|
||||
|
||||
if((hasInferiors || hasSuperiors) && directInferiorsMap == null)
|
||||
directInferiorsMap = new Hashtable<String, Set<String>>();
|
||||
|
||||
if(hasInferiors)
|
||||
explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames);
|
||||
|
||||
if(hasSuperiors)
|
||||
explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames);
|
||||
}
|
||||
if(directInferiorsMap != null)
|
||||
{
|
||||
for(int i = 0; i < list.size() - 1; i++)
|
||||
for(int n = i + 1; n < list.size(); n++)
|
||||
{
|
||||
String left = list.get(i);
|
||||
String right = list.get(n);
|
||||
|
||||
Set<String> leftInferiors = null, rightInferiors = null;
|
||||
if(explicitInferiors != null)
|
||||
{
|
||||
leftInferiors = explicitInferiors.get(left);
|
||||
rightInferiors = explicitInferiors.get(right);
|
||||
}
|
||||
|
||||
Set<String> leftSuperiors = null, rightSuperiors = null;
|
||||
if(explicitSuperiors != null)
|
||||
{
|
||||
leftSuperiors = explicitSuperiors.get(left);
|
||||
rightSuperiors = explicitSuperiors.get(right);
|
||||
}
|
||||
|
||||
boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right);
|
||||
boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right);
|
||||
|
||||
boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left);
|
||||
boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left);
|
||||
|
||||
if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'");
|
||||
if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'");
|
||||
|
||||
if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight)
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'");
|
||||
if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'");
|
||||
}
|
||||
|
||||
if(allInferiors == null)
|
||||
allInferiors = new Hashtable<String, Set<String>>();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
build(list.get(i), null);
|
||||
}
|
||||
|
||||
if (withoutSuperiors == null)
|
||||
withoutSuperiors = new LinkedList<String>();
|
||||
|
||||
int offset = 0;
|
||||
int size = list.size();
|
||||
|
||||
while(size > 1)
|
||||
{
|
||||
withoutSuperiors.clear();
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
withoutSuperiors.add(list.get(i));
|
||||
|
||||
if(allInferiors != null)
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(list.get(i));
|
||||
if (inferiors != null)
|
||||
withoutSuperiors.removeAll(inferiors);
|
||||
}
|
||||
|
||||
boolean initial = true;
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
String key = list.get(i);
|
||||
if(withoutSuperiors.contains(key))
|
||||
{
|
||||
if(initial)
|
||||
{
|
||||
Set<String> inferiors = null;
|
||||
if(allInferiors != null)
|
||||
inferiors = allInferiors.get(key);
|
||||
if(inferiors == null || inferiors.isEmpty())
|
||||
{
|
||||
withoutSuperiors.remove(key);
|
||||
size--;
|
||||
offset++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.remove(i--);
|
||||
size--;
|
||||
}
|
||||
initial = false;
|
||||
}
|
||||
list.addAll(offset + size, withoutSuperiors);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> build(String type, String startType)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(type);
|
||||
if(inferiors == null)
|
||||
{
|
||||
inferiors = build(type, null, startType != null ? startType : type);
|
||||
if(inferiors == null)
|
||||
inferiors = Empty;
|
||||
allInferiors.put(type, inferiors);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private Set<String> build(String type, Set<String> inferiors, String startType)
|
||||
{
|
||||
Set<String> directInferiors = directInferiorsMap.get(type);
|
||||
if(directInferiors == null)
|
||||
return inferiors;
|
||||
|
||||
if(inferiors == null)
|
||||
inferiors = new HashSet<String>();
|
||||
|
||||
Iterator<String> iter = directInferiors.iterator();
|
||||
while(iter.hasNext())
|
||||
{
|
||||
String inferiorType = iter.next();
|
||||
if(inferiorType == startType)
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'");
|
||||
if(list.contains(inferiorType))
|
||||
inferiors.add(inferiorType);
|
||||
|
||||
Set<String> inferiorSet;
|
||||
try
|
||||
{
|
||||
inferiorSet = build(inferiorType, startType);
|
||||
}
|
||||
catch(UnsupportedOperationException uoe)
|
||||
{
|
||||
throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe);
|
||||
}
|
||||
|
||||
if(inferiorSet != Empty)
|
||||
inferiors.addAll(inferiorSet);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> build(String baseId, Map<String, Set<String>> map, Map<String, Set<String>> directMap, Map<String, Set<String>> otherDirectMap, String[] names)
|
||||
{
|
||||
if(map == null)
|
||||
map = new Hashtable<String, Set<String>>();
|
||||
|
||||
Set<String> types = new HashSet<String>();
|
||||
for(int n = 0; n < names.length; n++)
|
||||
{
|
||||
if(names[n] != null)
|
||||
types.add(names[n]);
|
||||
}
|
||||
|
||||
if(directMap != null)
|
||||
getOrCreateSet(directMap, baseId).addAll(types);
|
||||
|
||||
if(otherDirectMap != null)
|
||||
{
|
||||
Iterator<String> iter = types.iterator();
|
||||
while(iter.hasNext())
|
||||
getOrCreateSet(otherDirectMap, iter.next()).add(baseId);
|
||||
}
|
||||
|
||||
map.put(baseId, types);
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Set<String> getOrCreateSet(Map<String, Set<String>> map, String key)
|
||||
{
|
||||
Set<String> value = map.get(key);
|
||||
if(value != null)
|
||||
return value;
|
||||
|
||||
value = new HashSet<String>();
|
||||
map.put(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> explicitInferiors;
|
||||
private Map<String, Set<String>> explicitSuperiors;
|
||||
private Map<String, Set<String>> directInferiorsMap;
|
||||
private Map<String, Set<String>> allInferiors;
|
||||
private List<String> withoutSuperiors;
|
||||
|
||||
private final List<String> list;
|
||||
private final Map<String, String[]> allBaseSuperiors;
|
||||
private final Map<String, String[]> allBaseInferiors;
|
||||
private final String methodName;
|
||||
|
||||
private static final Set<String> Empty = new HashSet<String>();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,65 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.client;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class ClientPlayerConstructorVisitor extends MethodVisitor
|
||||
{
|
||||
private final boolean isObfuscated;
|
||||
|
||||
public ClientPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated)
|
||||
{
|
||||
super(262144, paramMethodVisitor);
|
||||
this.isObfuscated = isObfuscated;
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc)
|
||||
{
|
||||
super.visitMethodInsn(opcode, owner, name, desc);
|
||||
if(name.equals("<init>") && owner.equals(isObfuscated ? "blg" : "net/minecraft/client/entity/AbstractClientPlayer"))
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "create", "(Lapi/player/client/IClientPlayerAPI;)Lapi/player/client/ClientPlayerAPI;");
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "blk" : "net/minecraft/client/entity/EntityPlayerSP", "clientPlayerAPI", "Lapi/player/client/ClientPlayerAPI;");
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "beforeLocalConstructing", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/client/Minecraft;Lnet/minecraft/world/World;Lnet/minecraft/util/Session;I)V");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitInsn(int opcode)
|
||||
{
|
||||
if(opcode == Opcodes.RETURN)
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "afterLocalConstructing", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/client/Minecraft;Lnet/minecraft/world/World;Lnet/minecraft/util/Session;I)V");
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,26 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.client;
|
||||
|
||||
public interface IClientPlayerAPI extends IClientPlayer
|
||||
{
|
||||
ClientPlayerAPI getClientPlayerAPI();
|
||||
|
||||
net.minecraft.client.entity.EntityPlayerSP getEntityPlayerSP();
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import java.util.*;
|
||||
import com.google.common.eventbus.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
public class PlayerAPIContainer extends DummyModContainer
|
||||
{
|
||||
public PlayerAPIContainer()
|
||||
{
|
||||
super(createMetadata());
|
||||
}
|
||||
|
||||
public boolean registerBus(EventBus bus, LoadController controller)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static ModMetadata createMetadata()
|
||||
{
|
||||
ModMetadata meta = new ModMetadata();
|
||||
|
||||
meta.modId = "PlayerAPI";
|
||||
meta.name = "Player API";
|
||||
meta.version = PlayerAPIPlugin.Version;
|
||||
meta.description = "Player API for Minecraft Forge";
|
||||
meta.url = "http://www.minecraftforum.net/topic/738498-";
|
||||
meta.authorList = Arrays.asList(new String[] { "Divisor" });
|
||||
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
@IFMLLoadingPlugin.TransformerExclusions("api.player.forge")
|
||||
public class PlayerAPIPlugin implements IFMLLoadingPlugin
|
||||
{
|
||||
public static String Version = "1.4";
|
||||
|
||||
public static boolean isObfuscated;
|
||||
|
||||
public String[] getASMTransformerClass()
|
||||
{
|
||||
return new String[] { "api.player.forge.PlayerAPITransformer" };
|
||||
}
|
||||
|
||||
public String getModContainerClass()
|
||||
{
|
||||
return "api.player.forge.PlayerAPIContainer";
|
||||
}
|
||||
|
||||
public String getSetupClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void injectData(Map<String, Object> data)
|
||||
{
|
||||
isObfuscated = (Boolean)data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
|
||||
public String getAccessTransformerClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import net.minecraft.launchwrapper.*;
|
||||
|
||||
import api.player.client.*;
|
||||
import api.player.server.*;
|
||||
|
||||
public class PlayerAPITransformer implements IClassTransformer
|
||||
{
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes)
|
||||
{
|
||||
if(transformedName.equals(ClientPlayerClassVisitor.targetClassName))
|
||||
return ClientPlayerClassVisitor.transform(bytes, PlayerAPIPlugin.isObfuscated);
|
||||
else if(transformedName.equals(ServerPlayerClassVisitor.targetClassName))
|
||||
return ServerPlayerClassVisitor.transform(bytes, PlayerAPIPlugin.isObfuscated);
|
||||
else
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import java.util.*;
|
||||
import com.google.common.eventbus.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
public class RenderPlayerAPIContainer extends DummyModContainer
|
||||
{
|
||||
public RenderPlayerAPIContainer()
|
||||
{
|
||||
super(createMetadata());
|
||||
}
|
||||
|
||||
public boolean registerBus(EventBus bus, LoadController controller)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static ModMetadata createMetadata()
|
||||
{
|
||||
ModMetadata meta = new ModMetadata();
|
||||
|
||||
meta.modId = "RenderPlayerAPI";
|
||||
meta.name = "Render Player API";
|
||||
meta.version = RenderPlayerAPIPlugin.Version;
|
||||
meta.description = "Render Player API for Minecraft Forge";
|
||||
meta.url = "http://www.minecraftforum.net/topic/1261354-";
|
||||
meta.authorList = Arrays.asList(new String[] { "Divisor" });
|
||||
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
@IFMLLoadingPlugin.TransformerExclusions("api.player.forge")
|
||||
public class RenderPlayerAPIPlugin implements IFMLLoadingPlugin
|
||||
{
|
||||
public static String Version = "1.4";
|
||||
|
||||
public static boolean isObfuscated;
|
||||
|
||||
public String[] getASMTransformerClass()
|
||||
{
|
||||
return new String[] { "api.player.forge.RenderPlayerAPITransformer" };
|
||||
}
|
||||
|
||||
public String getModContainerClass()
|
||||
{
|
||||
return "api.player.forge.RenderPlayerAPIContainer";
|
||||
}
|
||||
|
||||
public String getSetupClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void injectData(Map<String, Object> data)
|
||||
{
|
||||
isObfuscated = (Boolean)data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
|
||||
public String getAccessTransformerClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.forge;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.launchwrapper.*;
|
||||
|
||||
import api.player.model.*;
|
||||
import api.player.render.*;
|
||||
|
||||
public class RenderPlayerAPITransformer implements IClassTransformer
|
||||
{
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes)
|
||||
{
|
||||
if(transformedName.equals(RenderPlayerClassVisitor.targetClassName))
|
||||
{
|
||||
Stack<String> models = new Stack<String>();
|
||||
models.push(ModelPlayerClassVisitor.deobfuscatedClassReference + ":armor");
|
||||
models.push(ModelPlayerClassVisitor.deobfuscatedClassReference + ":chestplate");
|
||||
models.push(ModelPlayerClassVisitor.deobfuscatedClassReference + ":main");
|
||||
|
||||
Map<String, Stack<String>> renderConstructorReplacements = new Hashtable<String, Stack<String>>();
|
||||
renderConstructorReplacements.put(ModelPlayerClassVisitor.obfuscatedSuperClassReference, models);
|
||||
renderConstructorReplacements.put(ModelPlayerClassVisitor.deobfuscateSuperClassReference, models);
|
||||
|
||||
return RenderPlayerClassVisitor.transform(bytes, RenderPlayerAPIPlugin.isObfuscated, renderConstructorReplacements);
|
||||
}
|
||||
else if(transformedName.equals(ModelPlayerClassVisitor.targetClassName))
|
||||
return ModelPlayerClassVisitor.transform(bytes, RenderPlayerAPIPlugin.isObfuscated);
|
||||
else
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
public interface IModelPlayer
|
||||
{
|
||||
ModelPlayerBase getModelPlayerBase(String baseId);
|
||||
|
||||
java.util.Set<String> getModelPlayerBaseIds();
|
||||
|
||||
float getExpandParameter();
|
||||
|
||||
float getYOffsetParameter();
|
||||
|
||||
int getTextureWidthParameter();
|
||||
|
||||
int getTextureHeightParameter();
|
||||
|
||||
String getModelPlayerType();
|
||||
|
||||
Object dynamic(String key, Object[] parameters);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer realGetRandomModelBox(java.util.Random paramRandom);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer superGetRandomModelBox(java.util.Random paramRandom);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer localGetRandomModelBox(java.util.Random paramRandom);
|
||||
|
||||
net.minecraft.client.model.TextureOffset realGetTextureOffset(String paramString);
|
||||
|
||||
net.minecraft.client.model.TextureOffset superGetTextureOffset(String paramString);
|
||||
|
||||
net.minecraft.client.model.TextureOffset localGetTextureOffset(String paramString);
|
||||
|
||||
void realRender(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void superRender(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void localRender(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void realRenderCloak(float paramFloat);
|
||||
|
||||
void superRenderCloak(float paramFloat);
|
||||
|
||||
void localRenderCloak(float paramFloat);
|
||||
|
||||
void realRenderEars(float paramFloat);
|
||||
|
||||
void superRenderEars(float paramFloat);
|
||||
|
||||
void localRenderEars(float paramFloat);
|
||||
|
||||
void realSetLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void superSetLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void localSetLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void realSetRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void superSetRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void localSetRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void realSetTextureOffset(String paramString, int paramInt1, int paramInt2);
|
||||
|
||||
void superSetTextureOffset(String paramString, int paramInt1, int paramInt2);
|
||||
|
||||
void localSetTextureOffset(String paramString, int paramInt1, int paramInt2);
|
||||
|
||||
boolean getAimedBowField();
|
||||
|
||||
void setAimedBowField(boolean aimedBow);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedBodyField();
|
||||
|
||||
void setBipedBodyField(net.minecraft.client.model.ModelRenderer bipedBody);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedCloakField();
|
||||
|
||||
void setBipedCloakField(net.minecraft.client.model.ModelRenderer bipedCloak);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedEarsField();
|
||||
|
||||
void setBipedEarsField(net.minecraft.client.model.ModelRenderer bipedEars);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedHeadField();
|
||||
|
||||
void setBipedHeadField(net.minecraft.client.model.ModelRenderer bipedHead);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedHeadwearField();
|
||||
|
||||
void setBipedHeadwearField(net.minecraft.client.model.ModelRenderer bipedHeadwear);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedLeftArmField();
|
||||
|
||||
void setBipedLeftArmField(net.minecraft.client.model.ModelRenderer bipedLeftArm);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedLeftLegField();
|
||||
|
||||
void setBipedLeftLegField(net.minecraft.client.model.ModelRenderer bipedLeftLeg);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedRightArmField();
|
||||
|
||||
void setBipedRightArmField(net.minecraft.client.model.ModelRenderer bipedRightArm);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer getBipedRightLegField();
|
||||
|
||||
void setBipedRightLegField(net.minecraft.client.model.ModelRenderer bipedRightLeg);
|
||||
|
||||
java.util.List<?> getBoxListField();
|
||||
|
||||
void setBoxListField(java.util.List<?> boxList);
|
||||
|
||||
int getHeldItemLeftField();
|
||||
|
||||
void setHeldItemLeftField(int heldItemLeft);
|
||||
|
||||
int getHeldItemRightField();
|
||||
|
||||
void setHeldItemRightField(int heldItemRight);
|
||||
|
||||
boolean getIsChildField();
|
||||
|
||||
void setIsChildField(boolean isChild);
|
||||
|
||||
boolean getIsRidingField();
|
||||
|
||||
void setIsRidingField(boolean isRiding);
|
||||
|
||||
boolean getIsSneakField();
|
||||
|
||||
void setIsSneakField(boolean isSneak);
|
||||
|
||||
float getOnGroundField();
|
||||
|
||||
void setOnGroundField(float onGround);
|
||||
|
||||
int getTextureHeightField();
|
||||
|
||||
void setTextureHeightField(int textureHeight);
|
||||
|
||||
int getTextureWidthField();
|
||||
|
||||
void setTextureWidthField(int textureWidth);
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
public interface IModelPlayerAPI extends IModelPlayer
|
||||
{
|
||||
ModelPlayerAPI getModelPlayerAPI();
|
||||
|
||||
api.player.model.ModelPlayer getModelPlayer();
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
public class ModelPlayer extends net.minecraft.client.model.ModelBiped
|
||||
{
|
||||
public ModelPlayer()
|
||||
{
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public ModelPlayer(float paramFloat)
|
||||
{
|
||||
this(paramFloat, 0.0F, 64, 32);
|
||||
}
|
||||
|
||||
public ModelPlayer(float paramFloat1, float paramFloat2, int paramInt1, int paramInt2)
|
||||
{
|
||||
super(paramFloat1, paramFloat2, paramInt1, paramInt2);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,227 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
public abstract class ModelPlayerBase
|
||||
{
|
||||
public ModelPlayerBase(ModelPlayerAPI modelPlayerAPI)
|
||||
{
|
||||
this.internalModelPlayerAPI = modelPlayerAPI;
|
||||
this.modelPlayerAPI = modelPlayerAPI.modelPlayer;
|
||||
this.modelPlayer = modelPlayerAPI.modelPlayer.getModelPlayer();
|
||||
}
|
||||
|
||||
public void beforeBaseAttach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void afterBaseAttach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeLocalConstructing(float paramFloat1, float paramFloat2, int paramInt1, int paramInt2)
|
||||
{
|
||||
}
|
||||
|
||||
public void afterLocalConstructing(float paramFloat1, float paramFloat2, int paramInt1, int paramInt2)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeBaseDetach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void afterBaseDetach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public Object dynamic(String key, Object[] parameters)
|
||||
{
|
||||
return internalModelPlayerAPI.dynamicOverwritten(key, parameters, this);
|
||||
}
|
||||
|
||||
public final int hashCode()
|
||||
{
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
public void beforeGetRandomModelBox(java.util.Random paramRandom)
|
||||
{
|
||||
}
|
||||
|
||||
public net.minecraft.client.model.ModelRenderer getRandomModelBox(java.util.Random paramRandom)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenGetRandomModelBox(this);
|
||||
|
||||
net.minecraft.client.model.ModelRenderer _result;
|
||||
if(overwritten == null)
|
||||
_result = modelPlayerAPI.localGetRandomModelBox(paramRandom);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getRandomModelBox(paramRandom);
|
||||
else
|
||||
_result = null;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetRandomModelBox(java.util.Random paramRandom)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeGetTextureOffset(String paramString)
|
||||
{
|
||||
}
|
||||
|
||||
public net.minecraft.client.model.TextureOffset getTextureOffset(String paramString)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenGetTextureOffset(this);
|
||||
|
||||
net.minecraft.client.model.TextureOffset _result;
|
||||
if(overwritten == null)
|
||||
_result = modelPlayerAPI.localGetTextureOffset(paramString);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getTextureOffset(paramString);
|
||||
else
|
||||
_result = null;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetTextureOffset(String paramString)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRender(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
}
|
||||
|
||||
public void render(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenRender(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localRender(paramEntity, paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6);
|
||||
else if(overwritten != this)
|
||||
overwritten.render(paramEntity, paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6);
|
||||
|
||||
}
|
||||
|
||||
public void afterRender(net.minecraft.entity.Entity paramEntity, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderCloak(float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderCloak(float paramFloat)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenRenderCloak(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localRenderCloak(paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderCloak(paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderCloak(float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderEars(float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderEars(float paramFloat)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenRenderEars(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localRenderEars(paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderEars(paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderEars(float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
}
|
||||
|
||||
public void setLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenSetLivingAnimations(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localSetLivingAnimations(paramEntityLivingBase, paramFloat1, paramFloat2, paramFloat3);
|
||||
else if(overwritten != this)
|
||||
overwritten.setLivingAnimations(paramEntityLivingBase, paramFloat1, paramFloat2, paramFloat3);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetLivingAnimations(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
}
|
||||
|
||||
public void setRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenSetRotationAngles(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localSetRotationAngles(paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6, paramEntity);
|
||||
else if(overwritten != this)
|
||||
overwritten.setRotationAngles(paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6, paramEntity);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetRotationAngles(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetTextureOffset(String paramString, int paramInt1, int paramInt2)
|
||||
{
|
||||
}
|
||||
|
||||
public void setTextureOffset(String paramString, int paramInt1, int paramInt2)
|
||||
{
|
||||
ModelPlayerBase overwritten = internalModelPlayerAPI.GetOverwrittenSetTextureOffset(this);
|
||||
|
||||
if(overwritten == null)
|
||||
modelPlayerAPI.localSetTextureOffset(paramString, paramInt1, paramInt2);
|
||||
else if(overwritten != this)
|
||||
overwritten.setTextureOffset(paramString, paramInt1, paramInt2);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetTextureOffset(String paramString, int paramInt1, int paramInt2)
|
||||
{
|
||||
}
|
||||
|
||||
protected final api.player.model.ModelPlayer modelPlayer;
|
||||
protected final IModelPlayer modelPlayerAPI;
|
||||
private final ModelPlayerAPI internalModelPlayerAPI;
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ModelPlayerBaseSorter
|
||||
{
|
||||
public ModelPlayerBaseSorter(List<String> list, Map<String, String[]> allBaseSuperiors, Map<String, String[]> allBaseInferiors, String methodName)
|
||||
{
|
||||
this.list = list;
|
||||
this.allBaseSuperiors = allBaseSuperiors;
|
||||
this.allBaseInferiors = allBaseInferiors;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void Sort()
|
||||
{
|
||||
if(list.size() <= 1)
|
||||
return;
|
||||
|
||||
if(explicitInferiors != null)
|
||||
explicitInferiors.clear();
|
||||
|
||||
if(explicitSuperiors != null)
|
||||
explicitSuperiors.clear();
|
||||
|
||||
if(directInferiorsMap != null)
|
||||
directInferiorsMap.clear();
|
||||
|
||||
if(allInferiors != null)
|
||||
allInferiors.clear();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
{
|
||||
String baseId = list.get(i);
|
||||
|
||||
String[] inferiorNames = allBaseInferiors.get(baseId);
|
||||
boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0;
|
||||
|
||||
String[] superiorNames = allBaseSuperiors.get(baseId);
|
||||
boolean hasSuperiors = superiorNames != null && superiorNames.length > 0;
|
||||
|
||||
if((hasInferiors || hasSuperiors) && directInferiorsMap == null)
|
||||
directInferiorsMap = new Hashtable<String, Set<String>>();
|
||||
|
||||
if(hasInferiors)
|
||||
explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames);
|
||||
|
||||
if(hasSuperiors)
|
||||
explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames);
|
||||
}
|
||||
if(directInferiorsMap != null)
|
||||
{
|
||||
for(int i = 0; i < list.size() - 1; i++)
|
||||
for(int n = i + 1; n < list.size(); n++)
|
||||
{
|
||||
String left = list.get(i);
|
||||
String right = list.get(n);
|
||||
|
||||
Set<String> leftInferiors = null, rightInferiors = null;
|
||||
if(explicitInferiors != null)
|
||||
{
|
||||
leftInferiors = explicitInferiors.get(left);
|
||||
rightInferiors = explicitInferiors.get(right);
|
||||
}
|
||||
|
||||
Set<String> leftSuperiors = null, rightSuperiors = null;
|
||||
if(explicitSuperiors != null)
|
||||
{
|
||||
leftSuperiors = explicitSuperiors.get(left);
|
||||
rightSuperiors = explicitSuperiors.get(right);
|
||||
}
|
||||
|
||||
boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right);
|
||||
boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right);
|
||||
|
||||
boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left);
|
||||
boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left);
|
||||
|
||||
if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'");
|
||||
if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'");
|
||||
|
||||
if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight)
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'");
|
||||
if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'");
|
||||
}
|
||||
|
||||
if(allInferiors == null)
|
||||
allInferiors = new Hashtable<String, Set<String>>();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
build(list.get(i), null);
|
||||
}
|
||||
|
||||
if (withoutSuperiors == null)
|
||||
withoutSuperiors = new LinkedList<String>();
|
||||
|
||||
int offset = 0;
|
||||
int size = list.size();
|
||||
|
||||
while(size > 1)
|
||||
{
|
||||
withoutSuperiors.clear();
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
withoutSuperiors.add(list.get(i));
|
||||
|
||||
if(allInferiors != null)
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(list.get(i));
|
||||
if (inferiors != null)
|
||||
withoutSuperiors.removeAll(inferiors);
|
||||
}
|
||||
|
||||
boolean initial = true;
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
String key = list.get(i);
|
||||
if(withoutSuperiors.contains(key))
|
||||
{
|
||||
if(initial)
|
||||
{
|
||||
Set<String> inferiors = null;
|
||||
if(allInferiors != null)
|
||||
inferiors = allInferiors.get(key);
|
||||
if(inferiors == null || inferiors.isEmpty())
|
||||
{
|
||||
withoutSuperiors.remove(key);
|
||||
size--;
|
||||
offset++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.remove(i--);
|
||||
size--;
|
||||
}
|
||||
initial = false;
|
||||
}
|
||||
list.addAll(offset + size, withoutSuperiors);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> build(String type, String startType)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(type);
|
||||
if(inferiors == null)
|
||||
{
|
||||
inferiors = build(type, null, startType != null ? startType : type);
|
||||
if(inferiors == null)
|
||||
inferiors = Empty;
|
||||
allInferiors.put(type, inferiors);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private Set<String> build(String type, Set<String> inferiors, String startType)
|
||||
{
|
||||
Set<String> directInferiors = directInferiorsMap.get(type);
|
||||
if(directInferiors == null)
|
||||
return inferiors;
|
||||
|
||||
if(inferiors == null)
|
||||
inferiors = new HashSet<String>();
|
||||
|
||||
Iterator<String> iter = directInferiors.iterator();
|
||||
while(iter.hasNext())
|
||||
{
|
||||
String inferiorType = iter.next();
|
||||
if(inferiorType == startType)
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'");
|
||||
if(list.contains(inferiorType))
|
||||
inferiors.add(inferiorType);
|
||||
|
||||
Set<String> inferiorSet;
|
||||
try
|
||||
{
|
||||
inferiorSet = build(inferiorType, startType);
|
||||
}
|
||||
catch(UnsupportedOperationException uoe)
|
||||
{
|
||||
throw new UnsupportedOperationException("Can not sort ModelPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe);
|
||||
}
|
||||
|
||||
if(inferiorSet != Empty)
|
||||
inferiors.addAll(inferiorSet);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> build(String baseId, Map<String, Set<String>> map, Map<String, Set<String>> directMap, Map<String, Set<String>> otherDirectMap, String[] names)
|
||||
{
|
||||
if(map == null)
|
||||
map = new Hashtable<String, Set<String>>();
|
||||
|
||||
Set<String> types = new HashSet<String>();
|
||||
for(int n = 0; n < names.length; n++)
|
||||
{
|
||||
if(names[n] != null)
|
||||
types.add(names[n]);
|
||||
}
|
||||
|
||||
if(directMap != null)
|
||||
getOrCreateSet(directMap, baseId).addAll(types);
|
||||
|
||||
if(otherDirectMap != null)
|
||||
{
|
||||
Iterator<String> iter = types.iterator();
|
||||
while(iter.hasNext())
|
||||
getOrCreateSet(otherDirectMap, iter.next()).add(baseId);
|
||||
}
|
||||
|
||||
map.put(baseId, types);
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Set<String> getOrCreateSet(Map<String, Set<String>> map, String key)
|
||||
{
|
||||
Set<String> value = map.get(key);
|
||||
if(value != null)
|
||||
return value;
|
||||
|
||||
value = new HashSet<String>();
|
||||
map.put(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> explicitInferiors;
|
||||
private Map<String, Set<String>> explicitSuperiors;
|
||||
private Map<String, Set<String>> directInferiorsMap;
|
||||
private Map<String, Set<String>> allInferiors;
|
||||
private List<String> withoutSuperiors;
|
||||
|
||||
private final List<String> list;
|
||||
private final Map<String, String[]> allBaseSuperiors;
|
||||
private final Map<String, String[]> allBaseInferiors;
|
||||
private final String methodName;
|
||||
|
||||
private static final Set<String> Empty = new HashSet<String>();
|
||||
}
|
||||
@@ -1,693 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ModelPlayerBaseSorting
|
||||
{
|
||||
private String[] beforeLocalConstructingSuperiors = null;
|
||||
private String[] beforeLocalConstructingInferiors = null;
|
||||
private String[] afterLocalConstructingSuperiors = null;
|
||||
private String[] afterLocalConstructingInferiors = null;
|
||||
|
||||
private Map<String, String[]> dynamicBeforeSuperiors = null;
|
||||
private Map<String, String[]> dynamicBeforeInferiors = null;
|
||||
private Map<String, String[]> dynamicOverrideSuperiors = null;
|
||||
private Map<String, String[]> dynamicOverrideInferiors = null;
|
||||
private Map<String, String[]> dynamicAfterSuperiors = null;
|
||||
private Map<String, String[]> dynamicAfterInferiors = null;
|
||||
|
||||
private String[] beforeGetRandomModelBoxSuperiors = null;
|
||||
private String[] beforeGetRandomModelBoxInferiors = null;
|
||||
private String[] overrideGetRandomModelBoxSuperiors = null;
|
||||
private String[] overrideGetRandomModelBoxInferiors = null;
|
||||
private String[] afterGetRandomModelBoxSuperiors = null;
|
||||
private String[] afterGetRandomModelBoxInferiors = null;
|
||||
|
||||
private String[] beforeGetTextureOffsetSuperiors = null;
|
||||
private String[] beforeGetTextureOffsetInferiors = null;
|
||||
private String[] overrideGetTextureOffsetSuperiors = null;
|
||||
private String[] overrideGetTextureOffsetInferiors = null;
|
||||
private String[] afterGetTextureOffsetSuperiors = null;
|
||||
private String[] afterGetTextureOffsetInferiors = null;
|
||||
|
||||
private String[] beforeRenderSuperiors = null;
|
||||
private String[] beforeRenderInferiors = null;
|
||||
private String[] overrideRenderSuperiors = null;
|
||||
private String[] overrideRenderInferiors = null;
|
||||
private String[] afterRenderSuperiors = null;
|
||||
private String[] afterRenderInferiors = null;
|
||||
|
||||
private String[] beforeRenderCloakSuperiors = null;
|
||||
private String[] beforeRenderCloakInferiors = null;
|
||||
private String[] overrideRenderCloakSuperiors = null;
|
||||
private String[] overrideRenderCloakInferiors = null;
|
||||
private String[] afterRenderCloakSuperiors = null;
|
||||
private String[] afterRenderCloakInferiors = null;
|
||||
|
||||
private String[] beforeRenderEarsSuperiors = null;
|
||||
private String[] beforeRenderEarsInferiors = null;
|
||||
private String[] overrideRenderEarsSuperiors = null;
|
||||
private String[] overrideRenderEarsInferiors = null;
|
||||
private String[] afterRenderEarsSuperiors = null;
|
||||
private String[] afterRenderEarsInferiors = null;
|
||||
|
||||
private String[] beforeSetLivingAnimationsSuperiors = null;
|
||||
private String[] beforeSetLivingAnimationsInferiors = null;
|
||||
private String[] overrideSetLivingAnimationsSuperiors = null;
|
||||
private String[] overrideSetLivingAnimationsInferiors = null;
|
||||
private String[] afterSetLivingAnimationsSuperiors = null;
|
||||
private String[] afterSetLivingAnimationsInferiors = null;
|
||||
|
||||
private String[] beforeSetRotationAnglesSuperiors = null;
|
||||
private String[] beforeSetRotationAnglesInferiors = null;
|
||||
private String[] overrideSetRotationAnglesSuperiors = null;
|
||||
private String[] overrideSetRotationAnglesInferiors = null;
|
||||
private String[] afterSetRotationAnglesSuperiors = null;
|
||||
private String[] afterSetRotationAnglesInferiors = null;
|
||||
|
||||
private String[] beforeSetTextureOffsetSuperiors = null;
|
||||
private String[] beforeSetTextureOffsetInferiors = null;
|
||||
private String[] overrideSetTextureOffsetSuperiors = null;
|
||||
private String[] overrideSetTextureOffsetInferiors = null;
|
||||
private String[] afterSetTextureOffsetSuperiors = null;
|
||||
private String[] afterSetTextureOffsetInferiors = null;
|
||||
|
||||
|
||||
public String[] getBeforeLocalConstructingSuperiors()
|
||||
{
|
||||
return beforeLocalConstructingSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeLocalConstructingInferiors()
|
||||
{
|
||||
return beforeLocalConstructingInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterLocalConstructingSuperiors()
|
||||
{
|
||||
return afterLocalConstructingSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterLocalConstructingInferiors()
|
||||
{
|
||||
return afterLocalConstructingInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeLocalConstructingSuperiors(String[] value)
|
||||
{
|
||||
beforeLocalConstructingSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeLocalConstructingInferiors(String[] value)
|
||||
{
|
||||
beforeLocalConstructingInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterLocalConstructingSuperiors(String[] value)
|
||||
{
|
||||
afterLocalConstructingSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterLocalConstructingInferiors(String[] value)
|
||||
{
|
||||
afterLocalConstructingInferiors = value;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicBeforeSuperiors()
|
||||
{
|
||||
return dynamicBeforeSuperiors;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicBeforeInferiors()
|
||||
{
|
||||
return dynamicBeforeInferiors;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicOverrideSuperiors()
|
||||
{
|
||||
return dynamicOverrideSuperiors;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicOverrideInferiors()
|
||||
{
|
||||
return dynamicOverrideInferiors;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicAfterSuperiors()
|
||||
{
|
||||
return dynamicAfterSuperiors;
|
||||
}
|
||||
|
||||
public Map<String, String[]> getDynamicAfterInferiors()
|
||||
{
|
||||
return dynamicAfterInferiors;
|
||||
}
|
||||
|
||||
public void setDynamicBeforeSuperiors(String name, String[] superiors)
|
||||
{
|
||||
dynamicBeforeSuperiors = setDynamic(name, superiors, dynamicBeforeSuperiors);
|
||||
}
|
||||
|
||||
public void setDynamicBeforeInferiors(String name, String[] inferiors)
|
||||
{
|
||||
dynamicBeforeInferiors = setDynamic(name, inferiors, dynamicBeforeInferiors);
|
||||
}
|
||||
|
||||
public void setDynamicOverrideSuperiors(String name, String[] superiors)
|
||||
{
|
||||
dynamicOverrideSuperiors = setDynamic(name, superiors, dynamicOverrideSuperiors);
|
||||
}
|
||||
|
||||
public void setDynamicOverrideInferiors(String name, String[] inferiors)
|
||||
{
|
||||
dynamicOverrideInferiors = setDynamic(name, inferiors, dynamicOverrideInferiors);
|
||||
}
|
||||
|
||||
public void setDynamicAfterSuperiors(String name, String[] superiors)
|
||||
{
|
||||
dynamicAfterSuperiors = setDynamic(name, superiors, dynamicAfterSuperiors);
|
||||
}
|
||||
|
||||
public void setDynamicAfterInferiors(String name, String[] inferiors)
|
||||
{
|
||||
dynamicAfterInferiors = setDynamic(name, inferiors, dynamicAfterInferiors);
|
||||
}
|
||||
|
||||
private Map<String, String[]> setDynamic(String name, String[] names, Map<String, String[]> map)
|
||||
{
|
||||
if(name == null)
|
||||
throw new IllegalArgumentException("Parameter 'name' may not be null");
|
||||
|
||||
if(names == null)
|
||||
{
|
||||
if(map != null)
|
||||
map.remove(name);
|
||||
return map;
|
||||
}
|
||||
|
||||
if(map == null)
|
||||
map = new HashMap<String, String[]>();
|
||||
map.put(name, names);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public String[] getBeforeGetRandomModelBoxSuperiors()
|
||||
{
|
||||
return beforeGetRandomModelBoxSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeGetRandomModelBoxInferiors()
|
||||
{
|
||||
return beforeGetRandomModelBoxInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideGetRandomModelBoxSuperiors()
|
||||
{
|
||||
return overrideGetRandomModelBoxSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideGetRandomModelBoxInferiors()
|
||||
{
|
||||
return overrideGetRandomModelBoxInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterGetRandomModelBoxSuperiors()
|
||||
{
|
||||
return afterGetRandomModelBoxSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterGetRandomModelBoxInferiors()
|
||||
{
|
||||
return afterGetRandomModelBoxInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeGetRandomModelBoxSuperiors(String[] value)
|
||||
{
|
||||
beforeGetRandomModelBoxSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeGetRandomModelBoxInferiors(String[] value)
|
||||
{
|
||||
beforeGetRandomModelBoxInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideGetRandomModelBoxSuperiors(String[] value)
|
||||
{
|
||||
overrideGetRandomModelBoxSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideGetRandomModelBoxInferiors(String[] value)
|
||||
{
|
||||
overrideGetRandomModelBoxInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterGetRandomModelBoxSuperiors(String[] value)
|
||||
{
|
||||
afterGetRandomModelBoxSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterGetRandomModelBoxInferiors(String[] value)
|
||||
{
|
||||
afterGetRandomModelBoxInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeGetTextureOffsetSuperiors()
|
||||
{
|
||||
return beforeGetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeGetTextureOffsetInferiors()
|
||||
{
|
||||
return beforeGetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideGetTextureOffsetSuperiors()
|
||||
{
|
||||
return overrideGetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideGetTextureOffsetInferiors()
|
||||
{
|
||||
return overrideGetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterGetTextureOffsetSuperiors()
|
||||
{
|
||||
return afterGetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterGetTextureOffsetInferiors()
|
||||
{
|
||||
return afterGetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeGetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
beforeGetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeGetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
beforeGetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideGetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
overrideGetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideGetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
overrideGetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterGetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
afterGetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterGetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
afterGetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderSuperiors()
|
||||
{
|
||||
return beforeRenderSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderInferiors()
|
||||
{
|
||||
return beforeRenderInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderSuperiors()
|
||||
{
|
||||
return overrideRenderSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderInferiors()
|
||||
{
|
||||
return overrideRenderInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderSuperiors()
|
||||
{
|
||||
return afterRenderSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderInferiors()
|
||||
{
|
||||
return afterRenderInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeRenderSuperiors(String[] value)
|
||||
{
|
||||
beforeRenderSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeRenderInferiors(String[] value)
|
||||
{
|
||||
beforeRenderInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderSuperiors(String[] value)
|
||||
{
|
||||
overrideRenderSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderInferiors(String[] value)
|
||||
{
|
||||
overrideRenderInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderSuperiors(String[] value)
|
||||
{
|
||||
afterRenderSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderInferiors(String[] value)
|
||||
{
|
||||
afterRenderInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderCloakSuperiors()
|
||||
{
|
||||
return beforeRenderCloakSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderCloakInferiors()
|
||||
{
|
||||
return beforeRenderCloakInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderCloakSuperiors()
|
||||
{
|
||||
return overrideRenderCloakSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderCloakInferiors()
|
||||
{
|
||||
return overrideRenderCloakInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderCloakSuperiors()
|
||||
{
|
||||
return afterRenderCloakSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderCloakInferiors()
|
||||
{
|
||||
return afterRenderCloakInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeRenderCloakSuperiors(String[] value)
|
||||
{
|
||||
beforeRenderCloakSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeRenderCloakInferiors(String[] value)
|
||||
{
|
||||
beforeRenderCloakInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderCloakSuperiors(String[] value)
|
||||
{
|
||||
overrideRenderCloakSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderCloakInferiors(String[] value)
|
||||
{
|
||||
overrideRenderCloakInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderCloakSuperiors(String[] value)
|
||||
{
|
||||
afterRenderCloakSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderCloakInferiors(String[] value)
|
||||
{
|
||||
afterRenderCloakInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderEarsSuperiors()
|
||||
{
|
||||
return beforeRenderEarsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeRenderEarsInferiors()
|
||||
{
|
||||
return beforeRenderEarsInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderEarsSuperiors()
|
||||
{
|
||||
return overrideRenderEarsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideRenderEarsInferiors()
|
||||
{
|
||||
return overrideRenderEarsInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderEarsSuperiors()
|
||||
{
|
||||
return afterRenderEarsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterRenderEarsInferiors()
|
||||
{
|
||||
return afterRenderEarsInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeRenderEarsSuperiors(String[] value)
|
||||
{
|
||||
beforeRenderEarsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeRenderEarsInferiors(String[] value)
|
||||
{
|
||||
beforeRenderEarsInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderEarsSuperiors(String[] value)
|
||||
{
|
||||
overrideRenderEarsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideRenderEarsInferiors(String[] value)
|
||||
{
|
||||
overrideRenderEarsInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderEarsSuperiors(String[] value)
|
||||
{
|
||||
afterRenderEarsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterRenderEarsInferiors(String[] value)
|
||||
{
|
||||
afterRenderEarsInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetLivingAnimationsSuperiors()
|
||||
{
|
||||
return beforeSetLivingAnimationsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetLivingAnimationsInferiors()
|
||||
{
|
||||
return beforeSetLivingAnimationsInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetLivingAnimationsSuperiors()
|
||||
{
|
||||
return overrideSetLivingAnimationsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetLivingAnimationsInferiors()
|
||||
{
|
||||
return overrideSetLivingAnimationsInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetLivingAnimationsSuperiors()
|
||||
{
|
||||
return afterSetLivingAnimationsSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetLivingAnimationsInferiors()
|
||||
{
|
||||
return afterSetLivingAnimationsInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeSetLivingAnimationsSuperiors(String[] value)
|
||||
{
|
||||
beforeSetLivingAnimationsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeSetLivingAnimationsInferiors(String[] value)
|
||||
{
|
||||
beforeSetLivingAnimationsInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetLivingAnimationsSuperiors(String[] value)
|
||||
{
|
||||
overrideSetLivingAnimationsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetLivingAnimationsInferiors(String[] value)
|
||||
{
|
||||
overrideSetLivingAnimationsInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetLivingAnimationsSuperiors(String[] value)
|
||||
{
|
||||
afterSetLivingAnimationsSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetLivingAnimationsInferiors(String[] value)
|
||||
{
|
||||
afterSetLivingAnimationsInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetRotationAnglesSuperiors()
|
||||
{
|
||||
return beforeSetRotationAnglesSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetRotationAnglesInferiors()
|
||||
{
|
||||
return beforeSetRotationAnglesInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetRotationAnglesSuperiors()
|
||||
{
|
||||
return overrideSetRotationAnglesSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetRotationAnglesInferiors()
|
||||
{
|
||||
return overrideSetRotationAnglesInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetRotationAnglesSuperiors()
|
||||
{
|
||||
return afterSetRotationAnglesSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetRotationAnglesInferiors()
|
||||
{
|
||||
return afterSetRotationAnglesInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeSetRotationAnglesSuperiors(String[] value)
|
||||
{
|
||||
beforeSetRotationAnglesSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeSetRotationAnglesInferiors(String[] value)
|
||||
{
|
||||
beforeSetRotationAnglesInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetRotationAnglesSuperiors(String[] value)
|
||||
{
|
||||
overrideSetRotationAnglesSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetRotationAnglesInferiors(String[] value)
|
||||
{
|
||||
overrideSetRotationAnglesInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetRotationAnglesSuperiors(String[] value)
|
||||
{
|
||||
afterSetRotationAnglesSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetRotationAnglesInferiors(String[] value)
|
||||
{
|
||||
afterSetRotationAnglesInferiors = value;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetTextureOffsetSuperiors()
|
||||
{
|
||||
return beforeSetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getBeforeSetTextureOffsetInferiors()
|
||||
{
|
||||
return beforeSetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetTextureOffsetSuperiors()
|
||||
{
|
||||
return overrideSetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getOverrideSetTextureOffsetInferiors()
|
||||
{
|
||||
return overrideSetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetTextureOffsetSuperiors()
|
||||
{
|
||||
return afterSetTextureOffsetSuperiors;
|
||||
}
|
||||
|
||||
public String[] getAfterSetTextureOffsetInferiors()
|
||||
{
|
||||
return afterSetTextureOffsetInferiors;
|
||||
}
|
||||
|
||||
public void setBeforeSetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
beforeSetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setBeforeSetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
beforeSetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
overrideSetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setOverrideSetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
overrideSetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetTextureOffsetSuperiors(String[] value)
|
||||
{
|
||||
afterSetTextureOffsetSuperiors = value;
|
||||
}
|
||||
|
||||
public void setAfterSetTextureOffsetInferiors(String[] value)
|
||||
{
|
||||
afterSetTextureOffsetInferiors = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,903 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class ModelPlayerClassVisitor extends ClassVisitor
|
||||
{
|
||||
public static final String targetClassName = "api.player.model.ModelPlayer";
|
||||
public static final String obfuscatedClassReference = "api/player/model/ModelPlayer";
|
||||
public static final String obfuscatedSuperClassReference = "bhm";
|
||||
public static final String deobfuscatedClassReference = "api/player/model/ModelPlayer";
|
||||
public static final String deobfuscateSuperClassReference = "net/minecraft/client/model/ModelBiped";
|
||||
|
||||
private boolean hadLocalGetRandomModelBox;
|
||||
private boolean hadLocalGetTextureOffset;
|
||||
private boolean hadLocalRender;
|
||||
private boolean hadLocalRenderCloak;
|
||||
private boolean hadLocalRenderEars;
|
||||
private boolean hadLocalSetLivingAnimations;
|
||||
private boolean hadLocalSetRotationAngles;
|
||||
private boolean hadLocalSetTextureOffset;
|
||||
|
||||
public static byte[] transform(byte[] bytes, boolean isObfuscated)
|
||||
{
|
||||
try
|
||||
{
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
ClassReader cr = new ClassReader(in);
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
ModelPlayerClassVisitor p = new ModelPlayerClassVisitor(cw, isObfuscated);
|
||||
|
||||
cr.accept(p, 0);
|
||||
|
||||
byte[] result = cw.toByteArray();
|
||||
in.close();
|
||||
return result;
|
||||
}
|
||||
catch(IOException ioe)
|
||||
{
|
||||
throw new RuntimeException(ioe);
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean isObfuscated;
|
||||
|
||||
public ModelPlayerClassVisitor(ClassVisitor classVisitor, boolean isObfuscated)
|
||||
{
|
||||
super(262144, classVisitor);
|
||||
this.isObfuscated = isObfuscated;
|
||||
}
|
||||
|
||||
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
|
||||
{
|
||||
if(isObfuscated && superName.equals("net/minecraft/client/model/ModelBiped"))
|
||||
superName = "bhm";
|
||||
String[] newInterfaces = new String[interfaces.length + 1];
|
||||
for(int i=0; i<interfaces.length; i++)
|
||||
newInterfaces[i] = interfaces[i];
|
||||
newInterfaces[interfaces.length] = "api/player/model/IModelPlayerAPI";
|
||||
super.visit(version, access, name, signature, superName, newInterfaces);
|
||||
}
|
||||
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
|
||||
{
|
||||
if(name.equals("<init>") && desc.equals("()V"))
|
||||
{
|
||||
desc = "(Ljava/lang/String;)V";
|
||||
|
||||
MethodVisitor mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", signature, exceptions);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitInsn(Opcodes.ACONST_NULL);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "api/player/model/ModelPlayer", "<init>", desc);
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
return new ModelPlayerConstructorVisitor(super.visitMethod(access, name, desc, signature, exceptions), isObfuscated, false, 1);
|
||||
}
|
||||
|
||||
if(name.equals("<init>") && desc.equals("(F)V"))
|
||||
{
|
||||
desc = "(FLjava/lang/String;)V";
|
||||
|
||||
MethodVisitor mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "(F)V", signature, exceptions);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitInsn(Opcodes.ACONST_NULL);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "api/player/model/ModelPlayer", "<init>", desc);
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
return new ModelPlayerConstructorVisitor(super.visitMethod(access, name, desc, signature, exceptions), isObfuscated, false, 2);
|
||||
}
|
||||
|
||||
if(name.equals("<init>") && desc.equals("(FFII)V"))
|
||||
{
|
||||
desc = "(FFIILjava/lang/String;)V";
|
||||
|
||||
MethodVisitor mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "(FFII)V", signature, exceptions);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitInsn(Opcodes.ACONST_NULL);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "api/player/model/ModelPlayer", "<init>", desc);
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
return new ModelPlayerConstructorVisitor(super.visitMethod(access, name, desc, signature, exceptions), isObfuscated, true, 5);
|
||||
}
|
||||
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "getRandomModelBox") && desc.equals(isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;"))
|
||||
{
|
||||
hadLocalGetRandomModelBox = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localGetRandomModelBox", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "getTextureOffset") && desc.equals(isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;"))
|
||||
{
|
||||
hadLocalGetTextureOffset = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localGetTextureOffset", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "render") && desc.equals(isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V"))
|
||||
{
|
||||
hadLocalRender = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localRender", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "c" : "renderCloak") && desc.equals("(F)V"))
|
||||
{
|
||||
hadLocalRenderCloak = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localRenderCloak", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "b" : "renderEars") && desc.equals("(F)V"))
|
||||
{
|
||||
hadLocalRenderEars = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localRenderEars", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "setLivingAnimations") && desc.equals(isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V"))
|
||||
{
|
||||
hadLocalSetLivingAnimations = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localSetLivingAnimations", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "setRotationAngles") && desc.equals(isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V"))
|
||||
{
|
||||
hadLocalSetRotationAngles = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localSetRotationAngles", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
if(name.equals(isObfuscated ? "a" : "setTextureOffset") && desc.equals("(Ljava/lang/String;II)V"))
|
||||
{
|
||||
hadLocalSetTextureOffset = true;
|
||||
return super.visitMethod(Opcodes.ACC_PUBLIC, "localSetTextureOffset", desc, signature, exceptions);
|
||||
}
|
||||
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
|
||||
public void visitEnd()
|
||||
{
|
||||
MethodVisitor mv;
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "getRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getRandomModelBox", "(Lapi/player/model/IModelPlayerAPI;Ljava/util/Random;)" + (isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "getRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "getRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalGetRandomModelBox)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localGetRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "getRandomModelBox", "" + (isObfuscated ? "(Ljava/util/Random;)Lbix;" : "(Ljava/util/Random;)Lnet/minecraft/client/model/ModelRenderer;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "getTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getTextureOffset", "(Lapi/player/model/IModelPlayerAPI;Ljava/lang/String;)" + (isObfuscated ? "Lbiy;" : "Lnet/minecraft/client/model/TextureOffset;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "getTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "getTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalGetTextureOffset)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localGetTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "getTextureOffset", "" + (isObfuscated ? "(Ljava/lang/String;)Lbiy;" : "(Ljava/lang/String;)Lnet/minecraft/client/model/TextureOffset;") + "");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "render", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "render", "(Lapi/player/model/IModelPlayerAPI;" + (isObfuscated ? "Lsa;FFFFFF" : "Lnet/minecraft/entity/Entity;FFFFFF") + ")V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realRender", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "render", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superRender", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "render", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalRender)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localRender", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "render", "" + (isObfuscated ? "(Lsa;FFFFFF)V" : "(Lnet/minecraft/entity/Entity;FFFFFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "c" : "renderCloak", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "renderCloak", "(Lapi/player/model/IModelPlayerAPI;F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realRenderCloak", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "c" : "renderCloak", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superRenderCloak", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "c" : "renderCloak", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalRenderCloak)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localRenderCloak", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "c" : "renderCloak", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "renderEars", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "renderEars", "(Lapi/player/model/IModelPlayerAPI;F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realRenderEars", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "b" : "renderEars", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superRenderEars", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "b" : "renderEars", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalRenderEars)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localRenderEars", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "b" : "renderEars", "(F)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "setLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "setLivingAnimations", "(Lapi/player/model/IModelPlayerAPI;" + (isObfuscated ? "Lsv;FFF" : "Lnet/minecraft/entity/EntityLivingBase;FFF") + ")V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "setLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalSetLivingAnimations)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localSetLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setLivingAnimations", "" + (isObfuscated ? "(Lsv;FFF)V" : "(Lnet/minecraft/entity/EntityLivingBase;FFF)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "setRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "setRotationAngles", "(Lapi/player/model/IModelPlayerAPI;" + (isObfuscated ? "FFFFFFLsa;" : "FFFFFFLnet/minecraft/entity/Entity;") + ")V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "setRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalSetRotationAngles)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localSetRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 5);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 6);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 7);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setRotationAngles", "" + (isObfuscated ? "(FFFFFFLsa;)V" : "(FFFFFFLnet/minecraft/entity/Entity;)V") + "");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "setTextureOffset", "(Ljava/lang/String;II)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "setTextureOffset", "(Lapi/player/model/IModelPlayerAPI;Ljava/lang/String;II)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetTextureOffset", "(Ljava/lang/String;II)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "api/player/model/ModelPlayer", isObfuscated ? "a" : "setTextureOffset", "(Ljava/lang/String;II)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetTextureOffset", "(Ljava/lang/String;II)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setTextureOffset", "(Ljava/lang/String;II)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
if(!hadLocalSetTextureOffset)
|
||||
{
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "localSetTextureOffset", "(Ljava/lang/String;II)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped", isObfuscated ? "a" : "setTextureOffset", "(Ljava/lang/String;II)V");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
}
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAimedBowField", "()Z", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "o" : "aimedBow", "Z");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAimedBowField", "(Z)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "o" : "aimedBow", "Z");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedBodyField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "e" : "bipedBody", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedBodyField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "e" : "bipedBody", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedCloakField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "k" : "bipedCloak", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedCloakField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "k" : "bipedCloak", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedEarsField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "j" : "bipedEars", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedEarsField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "j" : "bipedEars", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedHeadField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "c" : "bipedHead", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedHeadField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "c" : "bipedHead", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedHeadwearField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "d" : "bipedHeadwear", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedHeadwearField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "d" : "bipedHeadwear", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedLeftArmField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "g" : "bipedLeftArm", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedLeftArmField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "g" : "bipedLeftArm", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedLeftLegField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "i" : "bipedLeftLeg", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedLeftLegField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "i" : "bipedLeftLeg", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedRightArmField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "f" : "bipedRightArm", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedRightArmField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "f" : "bipedRightArm", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBipedRightLegField", isObfuscated ? "()Lbix;" : "()Lnet/minecraft/client/model/ModelRenderer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "h" : "bipedRightLeg", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBipedRightLegField", isObfuscated ? "(Lbix;)V" : "(Lnet/minecraft/client/model/ModelRenderer;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "h" : "bipedRightLeg", isObfuscated ? "Lbix;" : "Lnet/minecraft/client/model/ModelRenderer;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getBoxListField", "()Ljava/util/List;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "r" : "boxList", "Ljava/util/List;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setBoxListField", "(Ljava/util/List;)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "r" : "boxList", "Ljava/util/List;");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHeldItemLeftField", "()I", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "l" : "heldItemLeft", "I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHeldItemLeftField", "(I)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "l" : "heldItemLeft", "I");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHeldItemRightField", "()I", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "m" : "heldItemRight", "I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHeldItemRightField", "(I)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "m" : "heldItemRight", "I");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsChildField", "()Z", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "s" : "isChild", "Z");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsChildField", "(Z)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "s" : "isChild", "Z");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsRidingField", "()Z", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "q" : "isRiding", "Z");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsRidingField", "(Z)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "q" : "isRiding", "Z");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsSneakField", "()Z", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "n" : "isSneak", "Z");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsSneakField", "(Z)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "n" : "isSneak", "Z");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOnGroundField", "()F", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "p" : "onGround", "F");
|
||||
mv.visitInsn(Opcodes.FRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOnGroundField", "(F)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "p" : "onGround", "F");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTextureHeightField", "()I", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "u" : "textureHeight", "I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTextureHeightField", "(I)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "u" : "textureHeight", "I");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTextureWidthField", "()I", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", isObfuscated ? "t" : "textureWidth", "I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTextureWidthField", "(I)V", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 1);
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", isObfuscated ? "t" : "textureWidth", "I");
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getModelPlayerBase", "(Ljava/lang/String;)Lapi/player/model/ModelPlayerBase;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getModelPlayerBase", "(Lapi/player/model/IModelPlayerAPI;Ljava/lang/String;)Lapi/player/model/ModelPlayerBase;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getModelPlayerBaseIds", "()Ljava/util/Set;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getModelPlayerBaseIds", "(Lapi/player/model/IModelPlayerAPI;)Ljava/util/Set;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExpandParameter", "()F", null, null);
|
||||
mv.visitVarInsn(/*Opcodes*/25/*ALOAD*/, /*0*/0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getExpandParameter", "(Lapi/player/model/IModelPlayerAPI;)F");
|
||||
mv.visitInsn(Opcodes.FRETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getYOffsetParameter", "()F", null, null);
|
||||
mv.visitVarInsn(/*Opcodes*/25/*ALOAD*/, /*0*/0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getYOffsetParameter", "(Lapi/player/model/IModelPlayerAPI;)F");
|
||||
mv.visitInsn(Opcodes.FRETURN);
|
||||
mv.visitMaxs(0, 1);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTextureWidthParameter", "()I", null, null);
|
||||
mv.visitVarInsn(/*Opcodes*/25/*ALOAD*/, /*0*/0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getTextureWidthParameter", "(Lapi/player/model/IModelPlayerAPI;)I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 2);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTextureHeightParameter", "()I", null, null);
|
||||
mv.visitVarInsn(/*Opcodes*/25/*ALOAD*/, /*0*/0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getTextureHeightParameter", "(Lapi/player/model/IModelPlayerAPI;)I");
|
||||
mv.visitInsn(Opcodes.IRETURN);
|
||||
mv.visitMaxs(0, 3);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getModelPlayerType", "()Ljava/lang/String;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getModelPlayerType", "(Lapi/player/model/IModelPlayerAPI;)Ljava/lang/String;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "dynamic", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 2);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "dynamic", "(Lapi/player/model/IModelPlayerAPI;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getModelPlayerAPI", "()Lapi/player/model/ModelPlayerAPI;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, "api/player/model/ModelPlayer", "modelPlayerAPI", "Lapi/player/model/ModelPlayerAPI;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getModelPlayer", "()Lapi/player/model/ModelPlayer;", null, null);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, "getAllInstances", "()[Lapi/player/model/ModelPlayer;", null, null);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "getAllInstances", "()[Lapi/player/model/ModelPlayer;");
|
||||
mv.visitInsn(Opcodes.ARETURN);
|
||||
mv.visitMaxs(0, 0);
|
||||
mv.visitEnd();
|
||||
|
||||
cv.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "modelPlayerAPI", "Lapi/player/model/ModelPlayerAPI;", null, null);
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.model;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class ModelPlayerConstructorVisitor extends MethodVisitor
|
||||
{
|
||||
private final boolean isObfuscated;
|
||||
private final boolean createApi;
|
||||
private final int parameterOffset;
|
||||
|
||||
public ModelPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated, boolean createApi, int parameterOffset)
|
||||
{
|
||||
super(262144, paramMethodVisitor);
|
||||
this.isObfuscated = isObfuscated;
|
||||
this.createApi = createApi;
|
||||
this.parameterOffset = parameterOffset;
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc)
|
||||
{
|
||||
if(isObfuscated && name.equals("<init>") && owner.equals("net/minecraft/client/model/ModelBiped"))
|
||||
owner = "bhm";
|
||||
if(name.equals("<init>") && owner.equals("api/player/model/ModelPlayer"))
|
||||
{
|
||||
desc = desc.substring(0, desc.indexOf(")")) + "Ljava/lang/String;)V";
|
||||
mv.visitVarInsn(Opcodes.ALOAD, parameterOffset);
|
||||
}
|
||||
super.visitMethodInsn(opcode, owner, name, desc);
|
||||
if(createApi && name.equals("<init>") && owner.equals(isObfuscated ? "bhm" : "net/minecraft/client/model/ModelBiped"))
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitVarInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitVarInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 5);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "create", "(Lapi/player/model/IModelPlayerAPI;FFIILjava/lang/String;)Lapi/player/model/ModelPlayerAPI;");
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, "api/player/model/ModelPlayer", "modelPlayerAPI", "Lapi/player/model/ModelPlayerAPI;");
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "beforeLocalConstructing", "(Lapi/player/model/IModelPlayerAPI;FFII)V");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitInsn(int opcode)
|
||||
{
|
||||
if(createApi && opcode == Opcodes.RETURN)
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.FLOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.FLOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ILOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/model/ModelPlayerAPI", "afterLocalConstructing", "(Lapi/player/model/IModelPlayerAPI;FFII)V");
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.render;
|
||||
|
||||
public interface IRenderPlayer
|
||||
{
|
||||
RenderPlayerBase getRenderPlayerBase(String baseId);
|
||||
|
||||
java.util.Set<String> getRenderPlayerBaseIds();
|
||||
|
||||
Object dynamic(String key, Object[] parameters);
|
||||
|
||||
boolean realDoRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
boolean superDoRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
boolean localDoRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
void realDoRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2);
|
||||
|
||||
void superDoRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2);
|
||||
|
||||
void localDoRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2);
|
||||
|
||||
int realGetColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2);
|
||||
|
||||
int superGetColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2);
|
||||
|
||||
int localGetColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2);
|
||||
|
||||
float realGetDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
float superGetDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
float localGetDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
net.minecraft.client.gui.FontRenderer realGetFontRendererFromRenderManager();
|
||||
|
||||
net.minecraft.client.gui.FontRenderer superGetFontRendererFromRenderManager();
|
||||
|
||||
net.minecraft.client.gui.FontRenderer localGetFontRendererFromRenderManager();
|
||||
|
||||
net.minecraft.util.ResourceLocation realGetResourceLocationFromPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer);
|
||||
|
||||
net.minecraft.util.ResourceLocation localGetResourceLocationFromPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer);
|
||||
|
||||
float realHandleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
float superHandleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
float localHandleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
int realInheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat);
|
||||
|
||||
int superInheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat);
|
||||
|
||||
int localInheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat);
|
||||
|
||||
void realLoadTexture(net.minecraft.util.ResourceLocation paramResourceLocation);
|
||||
|
||||
void superLoadTexture(net.minecraft.util.ResourceLocation paramResourceLocation);
|
||||
|
||||
void localLoadTexture(net.minecraft.util.ResourceLocation paramResourceLocation);
|
||||
|
||||
void realLoadTextureOfEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void superLoadTextureOfEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void localLoadTextureOfEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void realPassSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void superPassSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void localPassSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
boolean realPerformStaticEntityRebuild();
|
||||
|
||||
boolean superPerformStaticEntityRebuild();
|
||||
|
||||
boolean localPerformStaticEntityRebuild();
|
||||
|
||||
void realRenderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
void superRenderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
void localRenderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
void realRenderFirstPersonArm(net.minecraft.entity.player.EntityPlayer paramEntityPlayer);
|
||||
|
||||
void localRenderFirstPersonArm(net.minecraft.entity.player.EntityPlayer paramEntityPlayer);
|
||||
|
||||
void realRenderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt);
|
||||
|
||||
void superRenderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt);
|
||||
|
||||
void localRenderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt);
|
||||
|
||||
void realRenderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void superRenderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void localRenderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6);
|
||||
|
||||
void realRenderPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2);
|
||||
|
||||
void localRenderPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2);
|
||||
|
||||
void realRenderPlayerNameAndScoreLabel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, String paramString, float paramFloat, double paramDouble4);
|
||||
|
||||
void localRenderPlayerNameAndScoreLabel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, String paramString, float paramFloat, double paramDouble4);
|
||||
|
||||
void realRenderPlayerScale(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat);
|
||||
|
||||
void localRenderPlayerScale(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat);
|
||||
|
||||
void realRenderPlayerSleep(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void localRenderPlayerSleep(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void realRenderSpecials(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat);
|
||||
|
||||
void localRenderSpecials(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat);
|
||||
|
||||
float realRenderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
float superRenderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
float localRenderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat);
|
||||
|
||||
void realRotatePlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void localRotatePlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
int realSetArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat);
|
||||
|
||||
int localSetArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat);
|
||||
|
||||
void realSetPassArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat);
|
||||
|
||||
void localSetPassArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat);
|
||||
|
||||
void realSetRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager);
|
||||
|
||||
void superSetRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager);
|
||||
|
||||
void localSetRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager);
|
||||
|
||||
void realSetRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase);
|
||||
|
||||
void superSetRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase);
|
||||
|
||||
void localSetRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase);
|
||||
|
||||
void realUpdateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister);
|
||||
|
||||
void superUpdateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister);
|
||||
|
||||
void localUpdateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister);
|
||||
|
||||
net.minecraft.client.model.ModelBase getMainModelField();
|
||||
|
||||
void setMainModelField(net.minecraft.client.model.ModelBase mainModel);
|
||||
|
||||
net.minecraft.client.model.ModelBiped getModelArmorField();
|
||||
|
||||
void setModelArmorField(net.minecraft.client.model.ModelBiped modelArmor);
|
||||
|
||||
net.minecraft.client.model.ModelBiped getModelArmorChestplateField();
|
||||
|
||||
void setModelArmorChestplateField(net.minecraft.client.model.ModelBiped modelArmorChestplate);
|
||||
|
||||
net.minecraft.client.model.ModelBiped getModelBipedMainField();
|
||||
|
||||
void setModelBipedMainField(net.minecraft.client.model.ModelBiped modelBipedMain);
|
||||
|
||||
net.minecraft.client.renderer.RenderBlocks getRenderBlocksField();
|
||||
|
||||
void setRenderBlocksField(net.minecraft.client.renderer.RenderBlocks renderBlocks);
|
||||
|
||||
net.minecraft.client.renderer.entity.RenderManager getRenderManagerField();
|
||||
|
||||
void setRenderManagerField(net.minecraft.client.renderer.entity.RenderManager renderManager);
|
||||
|
||||
net.minecraft.client.model.ModelBase getRenderPassModelField();
|
||||
|
||||
void setRenderPassModelField(net.minecraft.client.model.ModelBase renderPassModel);
|
||||
|
||||
float getShadowOpaqueField();
|
||||
|
||||
void setShadowOpaqueField(float shadowOpaque);
|
||||
|
||||
float getShadowSizeField();
|
||||
|
||||
void setShadowSizeField(float shadowSize);
|
||||
|
||||
net.minecraft.util.ResourceLocation getSteveTexturesField();
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.render;
|
||||
|
||||
public interface IRenderPlayerAPI extends IRenderPlayer
|
||||
{
|
||||
RenderPlayerAPI getRenderPlayerAPI();
|
||||
|
||||
net.minecraft.client.renderer.entity.RenderPlayer getRenderPlayer();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,639 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.render;
|
||||
|
||||
public abstract class RenderPlayerBase
|
||||
{
|
||||
public RenderPlayerBase(RenderPlayerAPI renderPlayerAPI)
|
||||
{
|
||||
this.internalRenderPlayerAPI = renderPlayerAPI;
|
||||
this.renderPlayerAPI = renderPlayerAPI.renderPlayer;
|
||||
this.renderPlayer = renderPlayerAPI.renderPlayer.getRenderPlayer();
|
||||
}
|
||||
|
||||
public void beforeBaseAttach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void afterBaseAttach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeLocalConstructing()
|
||||
{
|
||||
}
|
||||
|
||||
public void afterLocalConstructing()
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeBaseDetach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public void afterBaseDetach(boolean onTheFly)
|
||||
{
|
||||
}
|
||||
|
||||
public Object dynamic(String key, Object[] parameters)
|
||||
{
|
||||
return internalRenderPlayerAPI.dynamicOverwritten(key, parameters, this);
|
||||
}
|
||||
|
||||
public final int hashCode()
|
||||
{
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
public void beforeDoRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
}
|
||||
|
||||
public boolean doRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenDoRenderLabel(this);
|
||||
|
||||
boolean _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localDoRenderLabel(paramEntityLivingBase);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.doRenderLabel(paramEntityLivingBase);
|
||||
else
|
||||
_result = false;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterDoRenderLabel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeDoRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public void doRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenDoRenderShadowAndFire(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localDoRenderShadowAndFire(paramEntity, paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2);
|
||||
else if(overwritten != this)
|
||||
overwritten.doRenderShadowAndFire(paramEntity, paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2);
|
||||
|
||||
}
|
||||
|
||||
public void afterDoRenderShadowAndFire(net.minecraft.entity.Entity paramEntity, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeGetColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public int getColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenGetColorMultiplier(this);
|
||||
|
||||
int _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localGetColorMultiplier(paramEntityLivingBase, paramFloat1, paramFloat2);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getColorMultiplier(paramEntityLivingBase, paramFloat1, paramFloat2);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetColorMultiplier(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeGetDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
}
|
||||
|
||||
public float getDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenGetDeathMaxRotation(this);
|
||||
|
||||
float _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localGetDeathMaxRotation(paramEntityLivingBase);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getDeathMaxRotation(paramEntityLivingBase);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetDeathMaxRotation(net.minecraft.entity.EntityLivingBase paramEntityLivingBase)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeGetFontRendererFromRenderManager()
|
||||
{
|
||||
}
|
||||
|
||||
public net.minecraft.client.gui.FontRenderer getFontRendererFromRenderManager()
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenGetFontRendererFromRenderManager(this);
|
||||
|
||||
net.minecraft.client.gui.FontRenderer _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localGetFontRendererFromRenderManager();
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getFontRendererFromRenderManager();
|
||||
else
|
||||
_result = null;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetFontRendererFromRenderManager()
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeGetResourceLocationFromPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
public net.minecraft.util.ResourceLocation getResourceLocationFromPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenGetResourceLocationFromPlayer(this);
|
||||
|
||||
net.minecraft.util.ResourceLocation _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localGetResourceLocationFromPlayer(paramAbstractClientPlayer);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.getResourceLocationFromPlayer(paramAbstractClientPlayer);
|
||||
else
|
||||
_result = null;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterGetResourceLocationFromPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeHandleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public float handleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenHandleRotationFloat(this);
|
||||
|
||||
float _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localHandleRotationFloat(paramEntityLivingBase, paramFloat);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.handleRotationFloat(paramEntityLivingBase, paramFloat);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterHandleRotationFloat(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeInheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public int inheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenInheritRenderPass(this);
|
||||
|
||||
int _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localInheritRenderPass(paramEntityLivingBase, paramInt, paramFloat);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.inheritRenderPass(paramEntityLivingBase, paramInt, paramFloat);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterInheritRenderPass(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeLoadTexture(net.minecraft.util.ResourceLocation paramResourceLocation)
|
||||
{
|
||||
}
|
||||
|
||||
public void loadTexture(net.minecraft.util.ResourceLocation paramResourceLocation)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenLoadTexture(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localLoadTexture(paramResourceLocation);
|
||||
else if(overwritten != this)
|
||||
overwritten.loadTexture(paramResourceLocation);
|
||||
|
||||
}
|
||||
|
||||
public void afterLoadTexture(net.minecraft.util.ResourceLocation paramResourceLocation)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeLoadTextureOfEntity(net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
}
|
||||
|
||||
public void loadTextureOfEntity(net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenLoadTextureOfEntity(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localLoadTextureOfEntity(paramEntity);
|
||||
else if(overwritten != this)
|
||||
overwritten.loadTextureOfEntity(paramEntity);
|
||||
|
||||
}
|
||||
|
||||
public void afterLoadTextureOfEntity(net.minecraft.entity.Entity paramEntity)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforePassSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
}
|
||||
|
||||
public void passSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenPassSpecialRender(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localPassSpecialRender(paramEntityLivingBase, paramDouble1, paramDouble2, paramDouble3);
|
||||
else if(overwritten != this)
|
||||
overwritten.passSpecialRender(paramEntityLivingBase, paramDouble1, paramDouble2, paramDouble3);
|
||||
|
||||
}
|
||||
|
||||
public void afterPassSpecialRender(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforePerformStaticEntityRebuild()
|
||||
{
|
||||
}
|
||||
|
||||
public boolean performStaticEntityRebuild()
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenPerformStaticEntityRebuild(this);
|
||||
|
||||
boolean _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localPerformStaticEntityRebuild();
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.performStaticEntityRebuild();
|
||||
else
|
||||
_result = false;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterPerformStaticEntityRebuild()
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderArrowsStuckInEntity(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderArrowsStuckInEntity(paramEntityLivingBase, paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderArrowsStuckInEntity(paramEntityLivingBase, paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderArrowsStuckInEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderFirstPersonArm(net.minecraft.entity.player.EntityPlayer paramEntityPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderFirstPersonArm(net.minecraft.entity.player.EntityPlayer paramEntityPlayer)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderFirstPersonArm(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderFirstPersonArm(paramEntityPlayer);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderFirstPersonArm(paramEntityPlayer);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderFirstPersonArm(net.minecraft.entity.player.EntityPlayer paramEntityPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderLivingLabel(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderLivingLabel(paramEntity, paramString, paramDouble1, paramDouble2, paramDouble3, paramInt);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderLivingLabel(paramEntity, paramString, paramDouble1, paramDouble2, paramDouble3, paramInt);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderLivingLabel(net.minecraft.entity.Entity paramEntity, String paramString, double paramDouble1, double paramDouble2, double paramDouble3, int paramInt)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderModel(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderModel(paramEntityLivingBase, paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderModel(paramEntityLivingBase, paramFloat1, paramFloat2, paramFloat3, paramFloat4, paramFloat5, paramFloat6);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderModel(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderPlayer(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderPlayer(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderPlayer(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderPlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderPlayerNameAndScoreLabel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, String paramString, float paramFloat, double paramDouble4)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderPlayerNameAndScoreLabel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, String paramString, float paramFloat, double paramDouble4)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderPlayerNameAndScoreLabel(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderPlayerNameAndScoreLabel(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3, paramString, paramFloat, paramDouble4);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderPlayerNameAndScoreLabel(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3, paramString, paramFloat, paramDouble4);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderPlayerNameAndScoreLabel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3, String paramString, float paramFloat, double paramDouble4)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderPlayerScale(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderPlayerScale(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderPlayerScale(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderPlayerScale(paramAbstractClientPlayer, paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderPlayerScale(paramAbstractClientPlayer, paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderPlayerScale(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderPlayerSleep(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderPlayerSleep(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderPlayerSleep(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderPlayerSleep(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderPlayerSleep(paramAbstractClientPlayer, paramDouble1, paramDouble2, paramDouble3);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderPlayerSleep(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, double paramDouble1, double paramDouble2, double paramDouble3)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderSpecials(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void renderSpecials(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderSpecials(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRenderSpecials(paramAbstractClientPlayer, paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.renderSpecials(paramAbstractClientPlayer, paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterRenderSpecials(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRenderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public float renderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRenderSwingProgress(this);
|
||||
|
||||
float _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localRenderSwingProgress(paramEntityLivingBase, paramFloat);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.renderSwingProgress(paramEntityLivingBase, paramFloat);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterRenderSwingProgress(net.minecraft.entity.EntityLivingBase paramEntityLivingBase, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeRotatePlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
}
|
||||
|
||||
public void rotatePlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenRotatePlayer(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localRotatePlayer(paramAbstractClientPlayer, paramFloat1, paramFloat2, paramFloat3);
|
||||
else if(overwritten != this)
|
||||
overwritten.rotatePlayer(paramAbstractClientPlayer, paramFloat1, paramFloat2, paramFloat3);
|
||||
|
||||
}
|
||||
|
||||
public void afterRotatePlayer(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, float paramFloat1, float paramFloat2, float paramFloat3)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public int setArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenSetArmorModel(this);
|
||||
|
||||
int _result;
|
||||
if(overwritten == null)
|
||||
_result = renderPlayerAPI.localSetArmorModel(paramAbstractClientPlayer, paramInt, paramFloat);
|
||||
else if(overwritten != this)
|
||||
_result = overwritten.setArmorModel(paramAbstractClientPlayer, paramInt, paramFloat);
|
||||
else
|
||||
_result = 0;
|
||||
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void afterSetArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetPassArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void setPassArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenSetPassArmorModel(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localSetPassArmorModel(paramAbstractClientPlayer, paramInt, paramFloat);
|
||||
else if(overwritten != this)
|
||||
overwritten.setPassArmorModel(paramAbstractClientPlayer, paramInt, paramFloat);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetPassArmorModel(net.minecraft.client.entity.AbstractClientPlayer paramAbstractClientPlayer, int paramInt, float paramFloat)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager)
|
||||
{
|
||||
}
|
||||
|
||||
public void setRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenSetRenderManager(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localSetRenderManager(paramRenderManager);
|
||||
else if(overwritten != this)
|
||||
overwritten.setRenderManager(paramRenderManager);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetRenderManager(net.minecraft.client.renderer.entity.RenderManager paramRenderManager)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeSetRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase)
|
||||
{
|
||||
}
|
||||
|
||||
public void setRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenSetRenderPassModel(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localSetRenderPassModel(paramModelBase);
|
||||
else if(overwritten != this)
|
||||
overwritten.setRenderPassModel(paramModelBase);
|
||||
|
||||
}
|
||||
|
||||
public void afterSetRenderPassModel(net.minecraft.client.model.ModelBase paramModelBase)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeUpdateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister)
|
||||
{
|
||||
}
|
||||
|
||||
public void updateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister)
|
||||
{
|
||||
RenderPlayerBase overwritten = internalRenderPlayerAPI.GetOverwrittenUpdateIcons(this);
|
||||
|
||||
if(overwritten == null)
|
||||
renderPlayerAPI.localUpdateIcons(paramIIconRegister);
|
||||
else if(overwritten != this)
|
||||
overwritten.updateIcons(paramIIconRegister);
|
||||
|
||||
}
|
||||
|
||||
public void afterUpdateIcons(net.minecraft.client.renderer.texture.IIconRegister paramIIconRegister)
|
||||
{
|
||||
}
|
||||
|
||||
protected final net.minecraft.client.renderer.entity.RenderPlayer renderPlayer;
|
||||
protected final IRenderPlayer renderPlayerAPI;
|
||||
private final RenderPlayerAPI internalRenderPlayerAPI;
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.render;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class RenderPlayerBaseSorter
|
||||
{
|
||||
public RenderPlayerBaseSorter(List<String> list, Map<String, String[]> allBaseSuperiors, Map<String, String[]> allBaseInferiors, String methodName)
|
||||
{
|
||||
this.list = list;
|
||||
this.allBaseSuperiors = allBaseSuperiors;
|
||||
this.allBaseInferiors = allBaseInferiors;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void Sort()
|
||||
{
|
||||
if(list.size() <= 1)
|
||||
return;
|
||||
|
||||
if(explicitInferiors != null)
|
||||
explicitInferiors.clear();
|
||||
|
||||
if(explicitSuperiors != null)
|
||||
explicitSuperiors.clear();
|
||||
|
||||
if(directInferiorsMap != null)
|
||||
directInferiorsMap.clear();
|
||||
|
||||
if(allInferiors != null)
|
||||
allInferiors.clear();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
{
|
||||
String baseId = list.get(i);
|
||||
|
||||
String[] inferiorNames = allBaseInferiors.get(baseId);
|
||||
boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0;
|
||||
|
||||
String[] superiorNames = allBaseSuperiors.get(baseId);
|
||||
boolean hasSuperiors = superiorNames != null && superiorNames.length > 0;
|
||||
|
||||
if((hasInferiors || hasSuperiors) && directInferiorsMap == null)
|
||||
directInferiorsMap = new Hashtable<String, Set<String>>();
|
||||
|
||||
if(hasInferiors)
|
||||
explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames);
|
||||
|
||||
if(hasSuperiors)
|
||||
explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames);
|
||||
}
|
||||
if(directInferiorsMap != null)
|
||||
{
|
||||
for(int i = 0; i < list.size() - 1; i++)
|
||||
for(int n = i + 1; n < list.size(); n++)
|
||||
{
|
||||
String left = list.get(i);
|
||||
String right = list.get(n);
|
||||
|
||||
Set<String> leftInferiors = null, rightInferiors = null;
|
||||
if(explicitInferiors != null)
|
||||
{
|
||||
leftInferiors = explicitInferiors.get(left);
|
||||
rightInferiors = explicitInferiors.get(right);
|
||||
}
|
||||
|
||||
Set<String> leftSuperiors = null, rightSuperiors = null;
|
||||
if(explicitSuperiors != null)
|
||||
{
|
||||
leftSuperiors = explicitSuperiors.get(left);
|
||||
rightSuperiors = explicitSuperiors.get(right);
|
||||
}
|
||||
|
||||
boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right);
|
||||
boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right);
|
||||
|
||||
boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left);
|
||||
boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left);
|
||||
|
||||
if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'");
|
||||
if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'");
|
||||
|
||||
if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight)
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'");
|
||||
if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'");
|
||||
}
|
||||
|
||||
if(allInferiors == null)
|
||||
allInferiors = new Hashtable<String, Set<String>>();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
build(list.get(i), null);
|
||||
}
|
||||
|
||||
if (withoutSuperiors == null)
|
||||
withoutSuperiors = new LinkedList<String>();
|
||||
|
||||
int offset = 0;
|
||||
int size = list.size();
|
||||
|
||||
while(size > 1)
|
||||
{
|
||||
withoutSuperiors.clear();
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
withoutSuperiors.add(list.get(i));
|
||||
|
||||
if(allInferiors != null)
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(list.get(i));
|
||||
if (inferiors != null)
|
||||
withoutSuperiors.removeAll(inferiors);
|
||||
}
|
||||
|
||||
boolean initial = true;
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
String key = list.get(i);
|
||||
if(withoutSuperiors.contains(key))
|
||||
{
|
||||
if(initial)
|
||||
{
|
||||
Set<String> inferiors = null;
|
||||
if(allInferiors != null)
|
||||
inferiors = allInferiors.get(key);
|
||||
if(inferiors == null || inferiors.isEmpty())
|
||||
{
|
||||
withoutSuperiors.remove(key);
|
||||
size--;
|
||||
offset++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.remove(i--);
|
||||
size--;
|
||||
}
|
||||
initial = false;
|
||||
}
|
||||
list.addAll(offset + size, withoutSuperiors);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> build(String type, String startType)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(type);
|
||||
if(inferiors == null)
|
||||
{
|
||||
inferiors = build(type, null, startType != null ? startType : type);
|
||||
if(inferiors == null)
|
||||
inferiors = Empty;
|
||||
allInferiors.put(type, inferiors);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private Set<String> build(String type, Set<String> inferiors, String startType)
|
||||
{
|
||||
Set<String> directInferiors = directInferiorsMap.get(type);
|
||||
if(directInferiors == null)
|
||||
return inferiors;
|
||||
|
||||
if(inferiors == null)
|
||||
inferiors = new HashSet<String>();
|
||||
|
||||
Iterator<String> iter = directInferiors.iterator();
|
||||
while(iter.hasNext())
|
||||
{
|
||||
String inferiorType = iter.next();
|
||||
if(inferiorType == startType)
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'");
|
||||
if(list.contains(inferiorType))
|
||||
inferiors.add(inferiorType);
|
||||
|
||||
Set<String> inferiorSet;
|
||||
try
|
||||
{
|
||||
inferiorSet = build(inferiorType, startType);
|
||||
}
|
||||
catch(UnsupportedOperationException uoe)
|
||||
{
|
||||
throw new UnsupportedOperationException("Can not sort RenderPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe);
|
||||
}
|
||||
|
||||
if(inferiorSet != Empty)
|
||||
inferiors.addAll(inferiorSet);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> build(String baseId, Map<String, Set<String>> map, Map<String, Set<String>> directMap, Map<String, Set<String>> otherDirectMap, String[] names)
|
||||
{
|
||||
if(map == null)
|
||||
map = new Hashtable<String, Set<String>>();
|
||||
|
||||
Set<String> types = new HashSet<String>();
|
||||
for(int n = 0; n < names.length; n++)
|
||||
{
|
||||
if(names[n] != null)
|
||||
types.add(names[n]);
|
||||
}
|
||||
|
||||
if(directMap != null)
|
||||
getOrCreateSet(directMap, baseId).addAll(types);
|
||||
|
||||
if(otherDirectMap != null)
|
||||
{
|
||||
Iterator<String> iter = types.iterator();
|
||||
while(iter.hasNext())
|
||||
getOrCreateSet(otherDirectMap, iter.next()).add(baseId);
|
||||
}
|
||||
|
||||
map.put(baseId, types);
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Set<String> getOrCreateSet(Map<String, Set<String>> map, String key)
|
||||
{
|
||||
Set<String> value = map.get(key);
|
||||
if(value != null)
|
||||
return value;
|
||||
|
||||
value = new HashSet<String>();
|
||||
map.put(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> explicitInferiors;
|
||||
private Map<String, Set<String>> explicitSuperiors;
|
||||
private Map<String, Set<String>> directInferiorsMap;
|
||||
private Map<String, Set<String>> allInferiors;
|
||||
private List<String> withoutSuperiors;
|
||||
|
||||
private final List<String> list;
|
||||
private final Map<String, String[]> allBaseSuperiors;
|
||||
private final Map<String, String[]> allBaseInferiors;
|
||||
private final String methodName;
|
||||
|
||||
private static final Set<String> Empty = new HashSet<String>();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,89 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Render Player API.
|
||||
//
|
||||
// Render Player API is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation, either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// Render Player API is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Render
|
||||
// Player API. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.render;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class RenderPlayerConstructorVisitor extends MethodVisitor
|
||||
{
|
||||
private final boolean isObfuscated;
|
||||
private final Map<String, Stack<String>> constructorReplacements;
|
||||
|
||||
public RenderPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated, Map<String, Stack<String>> constructorReplacements)
|
||||
{
|
||||
super(262144, paramMethodVisitor);
|
||||
this.isObfuscated = isObfuscated;
|
||||
this.constructorReplacements = constructorReplacements;
|
||||
}
|
||||
|
||||
public void visitTypeInsn(int opcode, String type)
|
||||
{
|
||||
if(opcode == Opcodes.NEW && constructorReplacements != null && constructorReplacements.containsKey(type))
|
||||
{
|
||||
Stack<String> replacementOwnerList = constructorReplacements.get(type);
|
||||
if(!replacementOwnerList.isEmpty())
|
||||
type = replacementOwnerList.peek();
|
||||
int typeSeparatorIndex = type.indexOf(":");
|
||||
if(typeSeparatorIndex > 0)
|
||||
type = type.substring(0, typeSeparatorIndex);
|
||||
}
|
||||
super.visitTypeInsn(opcode, type);
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc)
|
||||
{
|
||||
if(name.equals("<init>") && constructorReplacements != null && constructorReplacements.containsKey(owner))
|
||||
{
|
||||
Stack<String> replacementOwnerList = constructorReplacements.get(owner);
|
||||
if(!replacementOwnerList.isEmpty())
|
||||
owner = replacementOwnerList.pop();
|
||||
int typeSeparatorIndex = owner.indexOf(":");
|
||||
if(typeSeparatorIndex > 0)
|
||||
{
|
||||
mv.visitLdcInsn(owner.substring(typeSeparatorIndex + 1));
|
||||
owner = owner.substring(0, typeSeparatorIndex);
|
||||
int resultSeparatorIndex = desc.indexOf(")");
|
||||
desc = desc.substring(0, resultSeparatorIndex) + "Ljava/lang/String;" + desc.substring(resultSeparatorIndex);
|
||||
}
|
||||
}
|
||||
super.visitMethodInsn(opcode, owner, name, desc);
|
||||
if(name.equals("<init>") && owner.equals(isObfuscated ? "boh" : "net/minecraft/client/renderer/entity/RendererLivingEntity"))
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/render/RenderPlayerAPI", "create", "(Lapi/player/render/IRenderPlayerAPI;)Lapi/player/render/RenderPlayerAPI;");
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bop" : "net/minecraft/client/renderer/entity/RenderPlayer", "renderPlayerAPI", "Lapi/player/render/RenderPlayerAPI;");
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/render/RenderPlayerAPI", "beforeLocalConstructing", "(Lapi/player/render/IRenderPlayerAPI;)V");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitInsn(int opcode)
|
||||
{
|
||||
if(opcode == Opcodes.RETURN)
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/render/RenderPlayerAPI", "afterLocalConstructing", "(Lapi/player/render/IRenderPlayerAPI;)V");
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
@@ -1,983 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.server;
|
||||
|
||||
public interface IServerPlayer
|
||||
{
|
||||
ServerPlayerBase getServerPlayerBase(String baseId);
|
||||
|
||||
java.util.Set<String> getServerPlayerBaseIds();
|
||||
|
||||
Object dynamic(String key, Object[] parameters);
|
||||
|
||||
void realAddExhaustion(float paramFloat);
|
||||
|
||||
void superAddExhaustion(float paramFloat);
|
||||
|
||||
void localAddExhaustion(float paramFloat);
|
||||
|
||||
void realAddExperience(int paramInt);
|
||||
|
||||
void superAddExperience(int paramInt);
|
||||
|
||||
void localAddExperience(int paramInt);
|
||||
|
||||
void realAddExperienceLevel(int paramInt);
|
||||
|
||||
void superAddExperienceLevel(int paramInt);
|
||||
|
||||
void localAddExperienceLevel(int paramInt);
|
||||
|
||||
void realAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void superAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void localAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
boolean realAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
boolean superAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
boolean localAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
void realAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void superAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void localAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
boolean realCanBreatheUnderwater();
|
||||
|
||||
boolean superCanBreatheUnderwater();
|
||||
|
||||
boolean localCanBreatheUnderwater();
|
||||
|
||||
boolean realCanHarvestBlock(net.minecraft.block.Block paramBlock);
|
||||
|
||||
boolean superCanHarvestBlock(net.minecraft.block.Block paramBlock);
|
||||
|
||||
boolean localCanHarvestBlock(net.minecraft.block.Block paramBlock);
|
||||
|
||||
boolean realCanPlayerEdit(int paramInt1, int paramInt2, int paramInt3, int paramInt4, net.minecraft.item.ItemStack paramItemStack);
|
||||
|
||||
boolean superCanPlayerEdit(int paramInt1, int paramInt2, int paramInt3, int paramInt4, net.minecraft.item.ItemStack paramItemStack);
|
||||
|
||||
boolean localCanPlayerEdit(int paramInt1, int paramInt2, int paramInt3, int paramInt4, net.minecraft.item.ItemStack paramItemStack);
|
||||
|
||||
boolean realCanTriggerWalking();
|
||||
|
||||
boolean superCanTriggerWalking();
|
||||
|
||||
boolean localCanTriggerWalking();
|
||||
|
||||
void realClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean);
|
||||
|
||||
void superClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean);
|
||||
|
||||
void localClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean);
|
||||
|
||||
void realDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
void superDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
void localDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat);
|
||||
|
||||
void realDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory);
|
||||
|
||||
void superDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory);
|
||||
|
||||
void localDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory);
|
||||
|
||||
void realDisplayGUIDispenser(net.minecraft.tileentity.TileEntityDispenser paramTileEntityDispenser);
|
||||
|
||||
void superDisplayGUIDispenser(net.minecraft.tileentity.TileEntityDispenser paramTileEntityDispenser);
|
||||
|
||||
void localDisplayGUIDispenser(net.minecraft.tileentity.TileEntityDispenser paramTileEntityDispenser);
|
||||
|
||||
void realDisplayGUIFurnace(net.minecraft.tileentity.TileEntityFurnace paramTileEntityFurnace);
|
||||
|
||||
void superDisplayGUIFurnace(net.minecraft.tileentity.TileEntityFurnace paramTileEntityFurnace);
|
||||
|
||||
void localDisplayGUIFurnace(net.minecraft.tileentity.TileEntityFurnace paramTileEntityFurnace);
|
||||
|
||||
void realDisplayGUIWorkbench(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
void superDisplayGUIWorkbench(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
void localDisplayGUIWorkbench(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
net.minecraft.entity.item.EntityItem realDropOneItem(boolean paramBoolean);
|
||||
|
||||
net.minecraft.entity.item.EntityItem superDropOneItem(boolean paramBoolean);
|
||||
|
||||
net.minecraft.entity.item.EntityItem localDropOneItem(boolean paramBoolean);
|
||||
|
||||
net.minecraft.entity.item.EntityItem realDropPlayerItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean);
|
||||
|
||||
net.minecraft.entity.item.EntityItem superDropPlayerItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean);
|
||||
|
||||
net.minecraft.entity.item.EntityItem localDropPlayerItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean);
|
||||
|
||||
void realFall(float paramFloat);
|
||||
|
||||
void superFall(float paramFloat);
|
||||
|
||||
void localFall(float paramFloat);
|
||||
|
||||
float realGetAIMoveSpeed();
|
||||
|
||||
float superGetAIMoveSpeed();
|
||||
|
||||
float localGetAIMoveSpeed();
|
||||
|
||||
float realGetCurrentPlayerStrVsBlock(net.minecraft.block.Block paramBlock, boolean paramBoolean);
|
||||
|
||||
float superGetCurrentPlayerStrVsBlock(net.minecraft.block.Block paramBlock, boolean paramBoolean);
|
||||
|
||||
float localGetCurrentPlayerStrVsBlock(net.minecraft.block.Block paramBlock, boolean paramBoolean);
|
||||
|
||||
float realGetCurrentPlayerStrVsBlockForge(net.minecraft.block.Block paramBlock, boolean paramBoolean, int paramInt);
|
||||
|
||||
float superGetCurrentPlayerStrVsBlockForge(net.minecraft.block.Block paramBlock, boolean paramBoolean, int paramInt);
|
||||
|
||||
float localGetCurrentPlayerStrVsBlockForge(net.minecraft.block.Block paramBlock, boolean paramBoolean, int paramInt);
|
||||
|
||||
double realGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
double superGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
double localGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
float realGetBrightness(float paramFloat);
|
||||
|
||||
float superGetBrightness(float paramFloat);
|
||||
|
||||
float localGetBrightness(float paramFloat);
|
||||
|
||||
float realGetEyeHeight();
|
||||
|
||||
float superGetEyeHeight();
|
||||
|
||||
float localGetEyeHeight();
|
||||
|
||||
void realHeal(float paramFloat);
|
||||
|
||||
void superHeal(float paramFloat);
|
||||
|
||||
void localHeal(float paramFloat);
|
||||
|
||||
boolean realIsEntityInsideOpaqueBlock();
|
||||
|
||||
boolean superIsEntityInsideOpaqueBlock();
|
||||
|
||||
boolean localIsEntityInsideOpaqueBlock();
|
||||
|
||||
boolean realIsInWater();
|
||||
|
||||
boolean superIsInWater();
|
||||
|
||||
boolean localIsInWater();
|
||||
|
||||
boolean realIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial);
|
||||
|
||||
boolean superIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial);
|
||||
|
||||
boolean localIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial);
|
||||
|
||||
boolean realIsOnLadder();
|
||||
|
||||
boolean superIsOnLadder();
|
||||
|
||||
boolean localIsOnLadder();
|
||||
|
||||
boolean realIsPlayerSleeping();
|
||||
|
||||
boolean superIsPlayerSleeping();
|
||||
|
||||
boolean localIsPlayerSleeping();
|
||||
|
||||
boolean realIsSneaking();
|
||||
|
||||
boolean superIsSneaking();
|
||||
|
||||
boolean localIsSneaking();
|
||||
|
||||
void realJump();
|
||||
|
||||
void superJump();
|
||||
|
||||
void localJump();
|
||||
|
||||
void realKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2);
|
||||
|
||||
void superKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2);
|
||||
|
||||
void localKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2);
|
||||
|
||||
void realMountEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void superMountEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void localMountEntity(net.minecraft.entity.Entity paramEntity);
|
||||
|
||||
void realMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void superMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void localMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void realMoveEntityWithHeading(float paramFloat1, float paramFloat2);
|
||||
|
||||
void superMoveEntityWithHeading(float paramFloat1, float paramFloat2);
|
||||
|
||||
void localMoveEntityWithHeading(float paramFloat1, float paramFloat2);
|
||||
|
||||
void realMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void superMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void localMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3);
|
||||
|
||||
void realOnDeath(net.minecraft.util.DamageSource paramDamageSource);
|
||||
|
||||
void superOnDeath(net.minecraft.util.DamageSource paramDamageSource);
|
||||
|
||||
void localOnDeath(net.minecraft.util.DamageSource paramDamageSource);
|
||||
|
||||
void realOnLivingUpdate();
|
||||
|
||||
void superOnLivingUpdate();
|
||||
|
||||
void localOnLivingUpdate();
|
||||
|
||||
void realOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
void superOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
void localOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase);
|
||||
|
||||
void realOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt);
|
||||
|
||||
void superOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt);
|
||||
|
||||
void localOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt);
|
||||
|
||||
void realOnUpdate();
|
||||
|
||||
void superOnUpdate();
|
||||
|
||||
void localOnUpdate();
|
||||
|
||||
void realOnUpdateEntity();
|
||||
|
||||
void localOnUpdateEntity();
|
||||
|
||||
void realReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
void superReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
void localReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
void realSetDead();
|
||||
|
||||
void superSetDead();
|
||||
|
||||
void localSetDead();
|
||||
|
||||
void realSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2);
|
||||
|
||||
void localSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2);
|
||||
|
||||
void realSetPosition(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void superSetPosition(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void localSetPosition(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
void realSetSneaking(boolean paramBoolean);
|
||||
|
||||
void superSetSneaking(boolean paramBoolean);
|
||||
|
||||
void localSetSneaking(boolean paramBoolean);
|
||||
|
||||
void realSetSprinting(boolean paramBoolean);
|
||||
|
||||
void superSetSprinting(boolean paramBoolean);
|
||||
|
||||
void localSetSprinting(boolean paramBoolean);
|
||||
|
||||
void realSwingItem();
|
||||
|
||||
void superSwingItem();
|
||||
|
||||
void localSwingItem();
|
||||
|
||||
void realUpdateEntityActionState();
|
||||
|
||||
void superUpdateEntityActionState();
|
||||
|
||||
void localUpdateEntityActionState();
|
||||
|
||||
void realUpdatePotionEffects();
|
||||
|
||||
void superUpdatePotionEffects();
|
||||
|
||||
void localUpdatePotionEffects();
|
||||
|
||||
void realUpdateRidden();
|
||||
|
||||
void superUpdateRidden();
|
||||
|
||||
void localUpdateRidden();
|
||||
|
||||
void realWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3);
|
||||
|
||||
void superWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3);
|
||||
|
||||
void localWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3);
|
||||
|
||||
void realWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
void superWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
void localWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound);
|
||||
|
||||
boolean getAddedToChunkField();
|
||||
|
||||
void setAddedToChunkField(boolean addedToChunk);
|
||||
|
||||
int getArrowHitTimerField();
|
||||
|
||||
void setArrowHitTimerField(int arrowHitTimer);
|
||||
|
||||
int getAttackTimeField();
|
||||
|
||||
void setAttackTimeField(int attackTime);
|
||||
|
||||
float getAttackedAtYawField();
|
||||
|
||||
void setAttackedAtYawField(float attackedAtYaw);
|
||||
|
||||
net.minecraft.entity.player.EntityPlayer getAttackingPlayerField();
|
||||
|
||||
void setAttackingPlayerField(net.minecraft.entity.player.EntityPlayer attackingPlayer);
|
||||
|
||||
net.minecraft.util.AxisAlignedBB getBoundingBoxField();
|
||||
|
||||
float getCameraPitchField();
|
||||
|
||||
void setCameraPitchField(float cameraPitch);
|
||||
|
||||
float getCameraYawField();
|
||||
|
||||
void setCameraYawField(float cameraYaw);
|
||||
|
||||
net.minecraft.entity.player.PlayerCapabilities getCapabilitiesField();
|
||||
|
||||
void setCapabilitiesField(net.minecraft.entity.player.PlayerCapabilities capabilities);
|
||||
|
||||
boolean getChatColoursField();
|
||||
|
||||
void setChatColoursField(boolean chatColours);
|
||||
|
||||
net.minecraft.entity.player.EntityPlayer.EnumChatVisibility getChatVisibilityField();
|
||||
|
||||
void setChatVisibilityField(net.minecraft.entity.player.EntityPlayer.EnumChatVisibility chatVisibility);
|
||||
|
||||
int getChunkCoordXField();
|
||||
|
||||
void setChunkCoordXField(int chunkCoordX);
|
||||
|
||||
int getChunkCoordYField();
|
||||
|
||||
void setChunkCoordYField(int chunkCoordY);
|
||||
|
||||
int getChunkCoordZField();
|
||||
|
||||
void setChunkCoordZField(int chunkCoordZ);
|
||||
|
||||
int getCurrentWindowIdField();
|
||||
|
||||
void setCurrentWindowIdField(int currentWindowId);
|
||||
|
||||
net.minecraft.entity.DataWatcher getDataWatcherField();
|
||||
|
||||
void setDataWatcherField(net.minecraft.entity.DataWatcher dataWatcher);
|
||||
|
||||
boolean getDeadField();
|
||||
|
||||
void setDeadField(boolean dead);
|
||||
|
||||
int getDeathTimeField();
|
||||
|
||||
void setDeathTimeField(int deathTime);
|
||||
|
||||
java.util.List<?> getDestroyedItemsNetCacheField();
|
||||
|
||||
int getDimensionField();
|
||||
|
||||
void setDimensionField(int dimension);
|
||||
|
||||
float getDistanceWalkedModifiedField();
|
||||
|
||||
void setDistanceWalkedModifiedField(float distanceWalkedModified);
|
||||
|
||||
float getDistanceWalkedOnStepModifiedField();
|
||||
|
||||
void setDistanceWalkedOnStepModifiedField(float distanceWalkedOnStepModified);
|
||||
|
||||
int getEntityAgeField();
|
||||
|
||||
void setEntityAgeField(int entityAge);
|
||||
|
||||
float getEntityCollisionReductionField();
|
||||
|
||||
void setEntityCollisionReductionField(float entityCollisionReduction);
|
||||
|
||||
java.util.UUID getEntityUniqueIDField();
|
||||
|
||||
void setEntityUniqueIDField(java.util.UUID entityUniqueID);
|
||||
|
||||
float getExperienceField();
|
||||
|
||||
void setExperienceField(float experience);
|
||||
|
||||
int getExperienceLevelField();
|
||||
|
||||
void setExperienceLevelField(int experienceLevel);
|
||||
|
||||
int getExperienceTotalField();
|
||||
|
||||
void setExperienceTotalField(int experienceTotal);
|
||||
|
||||
float getFallDistanceField();
|
||||
|
||||
void setFallDistanceField(float fallDistance);
|
||||
|
||||
float getField_110154_aXField();
|
||||
|
||||
void setField_110154_aXField(float field_110154_aX);
|
||||
|
||||
float getField_130068_bOField();
|
||||
|
||||
void setField_130068_bOField(float field_130068_bO);
|
||||
|
||||
long getField_143005_bXField();
|
||||
|
||||
void setField_143005_bXField(long field_143005_bX);
|
||||
|
||||
int getField_147101_bUField();
|
||||
|
||||
void setField_147101_bUField(int field_147101_bU);
|
||||
|
||||
net.minecraft.stats.StatisticsFile getField_147103_bOField();
|
||||
|
||||
boolean getField_70135_KField();
|
||||
|
||||
void setField_70135_KField(boolean field_70135_K);
|
||||
|
||||
float getField_70741_aBField();
|
||||
|
||||
void setField_70741_aBField(float field_70741_aB);
|
||||
|
||||
float getField_70763_axField();
|
||||
|
||||
void setField_70763_axField(float field_70763_ax);
|
||||
|
||||
float getField_70764_awField();
|
||||
|
||||
void setField_70764_awField(float field_70764_aw);
|
||||
|
||||
float getField_70768_auField();
|
||||
|
||||
void setField_70768_auField(float field_70768_au);
|
||||
|
||||
float getField_70769_aoField();
|
||||
|
||||
void setField_70769_aoField(float field_70769_ao);
|
||||
|
||||
float getField_70770_apField();
|
||||
|
||||
void setField_70770_apField(float field_70770_ap);
|
||||
|
||||
float getField_71079_bUField();
|
||||
|
||||
void setField_71079_bUField(float field_71079_bU);
|
||||
|
||||
float getField_71082_cxField();
|
||||
|
||||
void setField_71082_cxField(float field_71082_cx);
|
||||
|
||||
double getField_71085_bRField();
|
||||
|
||||
void setField_71085_bRField(double field_71085_bR);
|
||||
|
||||
float getField_71089_bVField();
|
||||
|
||||
void setField_71089_bVField(float field_71089_bV);
|
||||
|
||||
double getField_71091_bMField();
|
||||
|
||||
void setField_71091_bMField(double field_71091_bM);
|
||||
|
||||
double getField_71094_bPField();
|
||||
|
||||
void setField_71094_bPField(double field_71094_bP);
|
||||
|
||||
double getField_71095_bQField();
|
||||
|
||||
void setField_71095_bQField(double field_71095_bQ);
|
||||
|
||||
double getField_71096_bNField();
|
||||
|
||||
void setField_71096_bNField(double field_71096_bN);
|
||||
|
||||
double getField_71097_bOField();
|
||||
|
||||
void setField_71097_bOField(double field_71097_bO);
|
||||
|
||||
int getFireResistanceField();
|
||||
|
||||
void setFireResistanceField(int fireResistance);
|
||||
|
||||
net.minecraft.entity.projectile.EntityFishHook getFishEntityField();
|
||||
|
||||
void setFishEntityField(net.minecraft.entity.projectile.EntityFishHook fishEntity);
|
||||
|
||||
int getFlyToggleTimerField();
|
||||
|
||||
void setFlyToggleTimerField(int flyToggleTimer);
|
||||
|
||||
net.minecraft.util.FoodStats getFoodStatsField();
|
||||
|
||||
void setFoodStatsField(net.minecraft.util.FoodStats foodStats);
|
||||
|
||||
boolean getForceSpawnField();
|
||||
|
||||
void setForceSpawnField(boolean forceSpawn);
|
||||
|
||||
float getHeightField();
|
||||
|
||||
void setHeightField(float height);
|
||||
|
||||
int getHurtResistantTimeField();
|
||||
|
||||
void setHurtResistantTimeField(int hurtResistantTime);
|
||||
|
||||
int getHurtTimeField();
|
||||
|
||||
void setHurtTimeField(int hurtTime);
|
||||
|
||||
boolean getIgnoreFrustumCheckField();
|
||||
|
||||
void setIgnoreFrustumCheckField(boolean ignoreFrustumCheck);
|
||||
|
||||
boolean getInPortalField();
|
||||
|
||||
void setInPortalField(boolean inPortal);
|
||||
|
||||
boolean getInWaterField();
|
||||
|
||||
void setInWaterField(boolean inWater);
|
||||
|
||||
net.minecraft.entity.player.InventoryPlayer getInventoryField();
|
||||
|
||||
void setInventoryField(net.minecraft.entity.player.InventoryPlayer inventory);
|
||||
|
||||
net.minecraft.inventory.Container getInventoryContainerField();
|
||||
|
||||
void setInventoryContainerField(net.minecraft.inventory.Container inventoryContainer);
|
||||
|
||||
boolean getIsAirBorneField();
|
||||
|
||||
void setIsAirBorneField(boolean isAirBorne);
|
||||
|
||||
boolean getIsChangingQuantityOnlyField();
|
||||
|
||||
void setIsChangingQuantityOnlyField(boolean isChangingQuantityOnly);
|
||||
|
||||
boolean getIsCollidedField();
|
||||
|
||||
void setIsCollidedField(boolean isCollided);
|
||||
|
||||
boolean getIsCollidedHorizontallyField();
|
||||
|
||||
void setIsCollidedHorizontallyField(boolean isCollidedHorizontally);
|
||||
|
||||
boolean getIsCollidedVerticallyField();
|
||||
|
||||
void setIsCollidedVerticallyField(boolean isCollidedVertically);
|
||||
|
||||
boolean getIsDeadField();
|
||||
|
||||
void setIsDeadField(boolean isDead);
|
||||
|
||||
boolean getIsImmuneToFireField();
|
||||
|
||||
void setIsImmuneToFireField(boolean isImmuneToFire);
|
||||
|
||||
boolean getIsInWebField();
|
||||
|
||||
void setIsInWebField(boolean isInWeb);
|
||||
|
||||
boolean getIsJumpingField();
|
||||
|
||||
void setIsJumpingField(boolean isJumping);
|
||||
|
||||
boolean getIsSwingInProgressField();
|
||||
|
||||
void setIsSwingInProgressField(boolean isSwingInProgress);
|
||||
|
||||
float getJumpMovementFactorField();
|
||||
|
||||
void setJumpMovementFactorField(float jumpMovementFactor);
|
||||
|
||||
float getLastDamageField();
|
||||
|
||||
void setLastDamageField(float lastDamage);
|
||||
|
||||
int getLastExperienceField();
|
||||
|
||||
void setLastExperienceField(int lastExperience);
|
||||
|
||||
int getLastFoodLevelField();
|
||||
|
||||
void setLastFoodLevelField(int lastFoodLevel);
|
||||
|
||||
float getLastHealthField();
|
||||
|
||||
void setLastHealthField(float lastHealth);
|
||||
|
||||
double getLastTickPosXField();
|
||||
|
||||
void setLastTickPosXField(double lastTickPosX);
|
||||
|
||||
double getLastTickPosYField();
|
||||
|
||||
void setLastTickPosYField(double lastTickPosY);
|
||||
|
||||
double getLastTickPosZField();
|
||||
|
||||
void setLastTickPosZField(double lastTickPosZ);
|
||||
|
||||
float getLimbSwingField();
|
||||
|
||||
void setLimbSwingField(float limbSwing);
|
||||
|
||||
float getLimbSwingAmountField();
|
||||
|
||||
void setLimbSwingAmountField(float limbSwingAmount);
|
||||
|
||||
java.util.List<?> getLoadedChunksField();
|
||||
|
||||
org.apache.logging.log4j.Logger getLoggerField();
|
||||
|
||||
double getManagedPosXField();
|
||||
|
||||
void setManagedPosXField(double managedPosX);
|
||||
|
||||
double getManagedPosZField();
|
||||
|
||||
void setManagedPosZField(double managedPosZ);
|
||||
|
||||
int getMaxHurtResistantTimeField();
|
||||
|
||||
void setMaxHurtResistantTimeField(int maxHurtResistantTime);
|
||||
|
||||
int getMaxHurtTimeField();
|
||||
|
||||
void setMaxHurtTimeField(int maxHurtTime);
|
||||
|
||||
net.minecraft.server.MinecraftServer getMcServerField();
|
||||
|
||||
double getMotionXField();
|
||||
|
||||
void setMotionXField(double motionX);
|
||||
|
||||
double getMotionYField();
|
||||
|
||||
void setMotionYField(double motionY);
|
||||
|
||||
double getMotionZField();
|
||||
|
||||
void setMotionZField(double motionZ);
|
||||
|
||||
float getMoveForwardField();
|
||||
|
||||
void setMoveForwardField(float moveForward);
|
||||
|
||||
float getMoveStrafingField();
|
||||
|
||||
void setMoveStrafingField(float moveStrafing);
|
||||
|
||||
net.minecraft.entity.Entity.EnumEntitySize getMyEntitySizeField();
|
||||
|
||||
void setMyEntitySizeField(net.minecraft.entity.Entity.EnumEntitySize myEntitySize);
|
||||
|
||||
int getNewPosRotationIncrementsField();
|
||||
|
||||
void setNewPosRotationIncrementsField(int newPosRotationIncrements);
|
||||
|
||||
double getNewPosXField();
|
||||
|
||||
void setNewPosXField(double newPosX);
|
||||
|
||||
double getNewPosYField();
|
||||
|
||||
void setNewPosYField(double newPosY);
|
||||
|
||||
double getNewPosZField();
|
||||
|
||||
void setNewPosZField(double newPosZ);
|
||||
|
||||
double getNewRotationPitchField();
|
||||
|
||||
void setNewRotationPitchField(double newRotationPitch);
|
||||
|
||||
double getNewRotationYawField();
|
||||
|
||||
void setNewRotationYawField(double newRotationYaw);
|
||||
|
||||
boolean getNoClipField();
|
||||
|
||||
void setNoClipField(boolean noClip);
|
||||
|
||||
boolean getOnGroundField();
|
||||
|
||||
void setOnGroundField(boolean onGround);
|
||||
|
||||
net.minecraft.inventory.Container getOpenContainerField();
|
||||
|
||||
void setOpenContainerField(net.minecraft.inventory.Container openContainer);
|
||||
|
||||
int getPingField();
|
||||
|
||||
void setPingField(int ping);
|
||||
|
||||
boolean getPlayerConqueredTheEndField();
|
||||
|
||||
void setPlayerConqueredTheEndField(boolean playerConqueredTheEnd);
|
||||
|
||||
net.minecraft.util.ChunkCoordinates getPlayerLocationField();
|
||||
|
||||
void setPlayerLocationField(net.minecraft.util.ChunkCoordinates playerLocation);
|
||||
|
||||
net.minecraft.network.NetHandlerPlayServer getPlayerNetServerHandlerField();
|
||||
|
||||
void setPlayerNetServerHandlerField(net.minecraft.network.NetHandlerPlayServer playerNetServerHandler);
|
||||
|
||||
int getPortalCounterField();
|
||||
|
||||
void setPortalCounterField(int portalCounter);
|
||||
|
||||
double getPosXField();
|
||||
|
||||
void setPosXField(double posX);
|
||||
|
||||
double getPosYField();
|
||||
|
||||
void setPosYField(double posY);
|
||||
|
||||
double getPosZField();
|
||||
|
||||
void setPosZField(double posZ);
|
||||
|
||||
float getPrevCameraPitchField();
|
||||
|
||||
void setPrevCameraPitchField(float prevCameraPitch);
|
||||
|
||||
float getPrevCameraYawField();
|
||||
|
||||
void setPrevCameraYawField(float prevCameraYaw);
|
||||
|
||||
float getPrevDistanceWalkedModifiedField();
|
||||
|
||||
void setPrevDistanceWalkedModifiedField(float prevDistanceWalkedModified);
|
||||
|
||||
float getPrevHealthField();
|
||||
|
||||
void setPrevHealthField(float prevHealth);
|
||||
|
||||
float getPrevLimbSwingAmountField();
|
||||
|
||||
void setPrevLimbSwingAmountField(float prevLimbSwingAmount);
|
||||
|
||||
double getPrevPosXField();
|
||||
|
||||
void setPrevPosXField(double prevPosX);
|
||||
|
||||
double getPrevPosYField();
|
||||
|
||||
void setPrevPosYField(double prevPosY);
|
||||
|
||||
double getPrevPosZField();
|
||||
|
||||
void setPrevPosZField(double prevPosZ);
|
||||
|
||||
float getPrevRenderYawOffsetField();
|
||||
|
||||
void setPrevRenderYawOffsetField(float prevRenderYawOffset);
|
||||
|
||||
float getPrevRotationPitchField();
|
||||
|
||||
void setPrevRotationPitchField(float prevRotationPitch);
|
||||
|
||||
float getPrevRotationYawField();
|
||||
|
||||
void setPrevRotationYawField(float prevRotationYaw);
|
||||
|
||||
float getPrevRotationYawHeadField();
|
||||
|
||||
void setPrevRotationYawHeadField(float prevRotationYawHead);
|
||||
|
||||
float getPrevSwingProgressField();
|
||||
|
||||
void setPrevSwingProgressField(float prevSwingProgress);
|
||||
|
||||
boolean getPreventEntitySpawningField();
|
||||
|
||||
void setPreventEntitySpawningField(boolean preventEntitySpawning);
|
||||
|
||||
java.util.Random getRandField();
|
||||
|
||||
void setRandField(java.util.Random rand);
|
||||
|
||||
float getRandomYawVelocityField();
|
||||
|
||||
void setRandomYawVelocityField(float randomYawVelocity);
|
||||
|
||||
int getRecentlyHitField();
|
||||
|
||||
void setRecentlyHitField(int recentlyHit);
|
||||
|
||||
double getRenderDistanceWeightField();
|
||||
|
||||
void setRenderDistanceWeightField(double renderDistanceWeight);
|
||||
|
||||
float getRenderYawOffsetField();
|
||||
|
||||
void setRenderYawOffsetField(float renderYawOffset);
|
||||
|
||||
net.minecraft.entity.Entity getRiddenByEntityField();
|
||||
|
||||
void setRiddenByEntityField(net.minecraft.entity.Entity riddenByEntity);
|
||||
|
||||
net.minecraft.entity.Entity getRidingEntityField();
|
||||
|
||||
void setRidingEntityField(net.minecraft.entity.Entity ridingEntity);
|
||||
|
||||
float getRotationPitchField();
|
||||
|
||||
void setRotationPitchField(float rotationPitch);
|
||||
|
||||
float getRotationYawField();
|
||||
|
||||
void setRotationYawField(float rotationYaw);
|
||||
|
||||
float getRotationYawHeadField();
|
||||
|
||||
void setRotationYawHeadField(float rotationYawHead);
|
||||
|
||||
int getScoreValueField();
|
||||
|
||||
void setScoreValueField(int scoreValue);
|
||||
|
||||
int getServerPosXField();
|
||||
|
||||
void setServerPosXField(int serverPosX);
|
||||
|
||||
int getServerPosYField();
|
||||
|
||||
void setServerPosYField(int serverPosY);
|
||||
|
||||
int getServerPosZField();
|
||||
|
||||
void setServerPosZField(int serverPosZ);
|
||||
|
||||
boolean getSleepingField();
|
||||
|
||||
void setSleepingField(boolean sleeping);
|
||||
|
||||
float getSpeedInAirField();
|
||||
|
||||
void setSpeedInAirField(float speedInAir);
|
||||
|
||||
float getSpeedOnGroundField();
|
||||
|
||||
void setSpeedOnGroundField(float speedOnGround);
|
||||
|
||||
float getStepHeightField();
|
||||
|
||||
void setStepHeightField(float stepHeight);
|
||||
|
||||
float getSwingProgressField();
|
||||
|
||||
void setSwingProgressField(float swingProgress);
|
||||
|
||||
int getSwingProgressIntField();
|
||||
|
||||
void setSwingProgressIntField(int swingProgressInt);
|
||||
|
||||
int getTeleportDirectionField();
|
||||
|
||||
void setTeleportDirectionField(int teleportDirection);
|
||||
|
||||
net.minecraft.server.management.ItemInWorldManager getTheItemInWorldManagerField();
|
||||
|
||||
int getTicksExistedField();
|
||||
|
||||
void setTicksExistedField(int ticksExisted);
|
||||
|
||||
int getTimeUntilPortalField();
|
||||
|
||||
void setTimeUntilPortalField(int timeUntilPortal);
|
||||
|
||||
java.lang.String getTranslatorField();
|
||||
|
||||
void setTranslatorField(java.lang.String translator);
|
||||
|
||||
boolean getVelocityChangedField();
|
||||
|
||||
void setVelocityChangedField(boolean velocityChanged);
|
||||
|
||||
boolean getWasHungryField();
|
||||
|
||||
void setWasHungryField(boolean wasHungry);
|
||||
|
||||
float getWidthField();
|
||||
|
||||
void setWidthField(float width);
|
||||
|
||||
net.minecraft.world.World getWorldObjField();
|
||||
|
||||
void setWorldObjField(net.minecraft.world.World worldObj);
|
||||
|
||||
int getXpCooldownField();
|
||||
|
||||
void setXpCooldownField(int xpCooldown);
|
||||
|
||||
float getYOffsetField();
|
||||
|
||||
void setYOffsetField(float yOffset);
|
||||
|
||||
float getYSizeField();
|
||||
|
||||
void setYSizeField(float ySize);
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.server;
|
||||
|
||||
public interface IServerPlayerAPI extends IServerPlayer
|
||||
{
|
||||
ServerPlayerAPI getServerPlayerAPI();
|
||||
|
||||
net.minecraft.entity.player.EntityPlayerMP getEntityPlayerMP();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,259 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.server;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ServerPlayerBaseSorter
|
||||
{
|
||||
public ServerPlayerBaseSorter(List<String> list, Map<String, String[]> allBaseSuperiors, Map<String, String[]> allBaseInferiors, String methodName)
|
||||
{
|
||||
this.list = list;
|
||||
this.allBaseSuperiors = allBaseSuperiors;
|
||||
this.allBaseInferiors = allBaseInferiors;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void Sort()
|
||||
{
|
||||
if(list.size() <= 1)
|
||||
return;
|
||||
|
||||
if(explicitInferiors != null)
|
||||
explicitInferiors.clear();
|
||||
|
||||
if(explicitSuperiors != null)
|
||||
explicitSuperiors.clear();
|
||||
|
||||
if(directInferiorsMap != null)
|
||||
directInferiorsMap.clear();
|
||||
|
||||
if(allInferiors != null)
|
||||
allInferiors.clear();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
{
|
||||
String baseId = list.get(i);
|
||||
|
||||
String[] inferiorNames = allBaseInferiors.get(baseId);
|
||||
boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0;
|
||||
|
||||
String[] superiorNames = allBaseSuperiors.get(baseId);
|
||||
boolean hasSuperiors = superiorNames != null && superiorNames.length > 0;
|
||||
|
||||
if((hasInferiors || hasSuperiors) && directInferiorsMap == null)
|
||||
directInferiorsMap = new Hashtable<String, Set<String>>();
|
||||
|
||||
if(hasInferiors)
|
||||
explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames);
|
||||
|
||||
if(hasSuperiors)
|
||||
explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames);
|
||||
}
|
||||
if(directInferiorsMap != null)
|
||||
{
|
||||
for(int i = 0; i < list.size() - 1; i++)
|
||||
for(int n = i + 1; n < list.size(); n++)
|
||||
{
|
||||
String left = list.get(i);
|
||||
String right = list.get(n);
|
||||
|
||||
Set<String> leftInferiors = null, rightInferiors = null;
|
||||
if(explicitInferiors != null)
|
||||
{
|
||||
leftInferiors = explicitInferiors.get(left);
|
||||
rightInferiors = explicitInferiors.get(right);
|
||||
}
|
||||
|
||||
Set<String> leftSuperiors = null, rightSuperiors = null;
|
||||
if(explicitSuperiors != null)
|
||||
{
|
||||
leftSuperiors = explicitSuperiors.get(left);
|
||||
rightSuperiors = explicitSuperiors.get(right);
|
||||
}
|
||||
|
||||
boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right);
|
||||
boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right);
|
||||
|
||||
boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left);
|
||||
boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left);
|
||||
|
||||
if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'");
|
||||
if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'");
|
||||
|
||||
if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight)
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'");
|
||||
if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft)
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'");
|
||||
}
|
||||
|
||||
if(allInferiors == null)
|
||||
allInferiors = new Hashtable<String, Set<String>>();
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
build(list.get(i), null);
|
||||
}
|
||||
|
||||
if (withoutSuperiors == null)
|
||||
withoutSuperiors = new LinkedList<String>();
|
||||
|
||||
int offset = 0;
|
||||
int size = list.size();
|
||||
|
||||
while(size > 1)
|
||||
{
|
||||
withoutSuperiors.clear();
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
withoutSuperiors.add(list.get(i));
|
||||
|
||||
if(allInferiors != null)
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(list.get(i));
|
||||
if (inferiors != null)
|
||||
withoutSuperiors.removeAll(inferiors);
|
||||
}
|
||||
|
||||
boolean initial = true;
|
||||
for(int i = offset; i < offset + size; i++)
|
||||
{
|
||||
String key = list.get(i);
|
||||
if(withoutSuperiors.contains(key))
|
||||
{
|
||||
if(initial)
|
||||
{
|
||||
Set<String> inferiors = null;
|
||||
if(allInferiors != null)
|
||||
inferiors = allInferiors.get(key);
|
||||
if(inferiors == null || inferiors.isEmpty())
|
||||
{
|
||||
withoutSuperiors.remove(key);
|
||||
size--;
|
||||
offset++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.remove(i--);
|
||||
size--;
|
||||
}
|
||||
initial = false;
|
||||
}
|
||||
list.addAll(offset + size, withoutSuperiors);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> build(String type, String startType)
|
||||
{
|
||||
Set<String> inferiors = allInferiors.get(type);
|
||||
if(inferiors == null)
|
||||
{
|
||||
inferiors = build(type, null, startType != null ? startType : type);
|
||||
if(inferiors == null)
|
||||
inferiors = Empty;
|
||||
allInferiors.put(type, inferiors);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private Set<String> build(String type, Set<String> inferiors, String startType)
|
||||
{
|
||||
Set<String> directInferiors = directInferiorsMap.get(type);
|
||||
if(directInferiors == null)
|
||||
return inferiors;
|
||||
|
||||
if(inferiors == null)
|
||||
inferiors = new HashSet<String>();
|
||||
|
||||
Iterator<String> iter = directInferiors.iterator();
|
||||
while(iter.hasNext())
|
||||
{
|
||||
String inferiorType = iter.next();
|
||||
if(inferiorType == startType)
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'");
|
||||
if(list.contains(inferiorType))
|
||||
inferiors.add(inferiorType);
|
||||
|
||||
Set<String> inferiorSet;
|
||||
try
|
||||
{
|
||||
inferiorSet = build(inferiorType, startType);
|
||||
}
|
||||
catch(UnsupportedOperationException uoe)
|
||||
{
|
||||
throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe);
|
||||
}
|
||||
|
||||
if(inferiorSet != Empty)
|
||||
inferiors.addAll(inferiorSet);
|
||||
}
|
||||
return inferiors;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> build(String baseId, Map<String, Set<String>> map, Map<String, Set<String>> directMap, Map<String, Set<String>> otherDirectMap, String[] names)
|
||||
{
|
||||
if(map == null)
|
||||
map = new Hashtable<String, Set<String>>();
|
||||
|
||||
Set<String> types = new HashSet<String>();
|
||||
for(int n = 0; n < names.length; n++)
|
||||
{
|
||||
if(names[n] != null)
|
||||
types.add(names[n]);
|
||||
}
|
||||
|
||||
if(directMap != null)
|
||||
getOrCreateSet(directMap, baseId).addAll(types);
|
||||
|
||||
if(otherDirectMap != null)
|
||||
{
|
||||
Iterator<String> iter = types.iterator();
|
||||
while(iter.hasNext())
|
||||
getOrCreateSet(otherDirectMap, iter.next()).add(baseId);
|
||||
}
|
||||
|
||||
map.put(baseId, types);
|
||||
return map;
|
||||
}
|
||||
|
||||
private static Set<String> getOrCreateSet(Map<String, Set<String>> map, String key)
|
||||
{
|
||||
Set<String> value = map.get(key);
|
||||
if(value != null)
|
||||
return value;
|
||||
|
||||
value = new HashSet<String>();
|
||||
map.put(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> explicitInferiors;
|
||||
private Map<String, Set<String>> explicitSuperiors;
|
||||
private Map<String, Set<String>> directInferiorsMap;
|
||||
private Map<String, Set<String>> allInferiors;
|
||||
private List<String> withoutSuperiors;
|
||||
|
||||
private final List<String> list;
|
||||
private final Map<String, String[]> allBaseSuperiors;
|
||||
private final Map<String, String[]> allBaseInferiors;
|
||||
private final String methodName;
|
||||
|
||||
private static final Set<String> Empty = new HashSet<String>();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,65 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Player API.
|
||||
//
|
||||
// Player API is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Player API is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License and the GNU General Public License along with Player API.
|
||||
// If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package api.player.server;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class ServerPlayerConstructorVisitor extends MethodVisitor
|
||||
{
|
||||
private final boolean isObfuscated;
|
||||
|
||||
public ServerPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated)
|
||||
{
|
||||
super(262144, paramMethodVisitor);
|
||||
this.isObfuscated = isObfuscated;
|
||||
}
|
||||
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc)
|
||||
{
|
||||
super.visitMethodInsn(opcode, owner, name, desc);
|
||||
if(name.equals("<init>") && owner.equals(isObfuscated ? "yz" : "net/minecraft/entity/player/EntityPlayer"))
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "create", "(Lapi/player/server/IServerPlayerAPI;)Lapi/player/server/ServerPlayerAPI;");
|
||||
mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "mw" : "net/minecraft/entity/player/EntityPlayerMP", "serverPlayerAPI", "Lapi/player/server/ServerPlayerAPI;");
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "beforeLocalConstructing", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/world/WorldServer;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/server/management/ItemInWorldManager;)V");
|
||||
}
|
||||
}
|
||||
|
||||
public void visitInsn(int opcode)
|
||||
{
|
||||
if(opcode == Opcodes.RETURN)
|
||||
{
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 1);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 2);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 3);
|
||||
mv.visitIntInsn(Opcodes.ALOAD, 4);
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "afterLocalConstructing", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/world/WorldServer;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/server/management/ItemInWorldManager;)V");
|
||||
}
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public final class SmartCoreClassVisitor extends ClassVisitor
|
||||
{
|
||||
public static byte[] transform(byte[] bytes, List<SmartCoreTransformation> transformations)
|
||||
{
|
||||
try
|
||||
{
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
ClassReader cr = new ClassReader(in);
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
SmartCoreClassVisitor p = new SmartCoreClassVisitor(cw, transformations);
|
||||
|
||||
cr.accept(p, 0);
|
||||
|
||||
byte[] result = cw.toByteArray();
|
||||
in.close();
|
||||
return result;
|
||||
}
|
||||
catch(IOException ioe)
|
||||
{
|
||||
throw new RuntimeException(ioe);
|
||||
}
|
||||
}
|
||||
|
||||
private final List<SmartCoreTransformation> transformations;
|
||||
|
||||
public SmartCoreClassVisitor(ClassVisitor classVisitor, List<SmartCoreTransformation> transformations)
|
||||
{
|
||||
super(262144, classVisitor);
|
||||
this.transformations = transformations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
|
||||
{
|
||||
MethodVisitor base = super.visitMethod(access, name, desc, signature, exceptions);
|
||||
|
||||
for(SmartCoreTransformation transformation : transformations)
|
||||
if(name.equals(transformation.methodName) && desc.equals(transformation.getMethodDesc()))
|
||||
return new SmartCoreMethodVisitor(base, transformation);
|
||||
|
||||
return base;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.util.*;
|
||||
import com.google.common.eventbus.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
public class SmartCoreContainer extends DummyModContainer
|
||||
{
|
||||
public SmartCoreContainer()
|
||||
{
|
||||
super(createMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerBus(EventBus bus, LoadController controller)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static ModMetadata createMetadata()
|
||||
{
|
||||
ModMetadata meta = new ModMetadata();
|
||||
|
||||
meta.modId = "SmartCore";
|
||||
meta.name = SmartCoreInfo.ModName;
|
||||
meta.version = SmartCoreInfo.ModVersion;
|
||||
meta.description = "Adds some core hooks required by Smart Moving";
|
||||
meta.url = "http://www.minecraftforum.net/topic/738498-";
|
||||
meta.authorList = Arrays.asList(new String[] { "Divisor" });
|
||||
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.multiplayer.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.server.management.*;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.network.play.client.*;
|
||||
|
||||
public class SmartCoreEventHandler
|
||||
{
|
||||
private final static Set<SmartCoreEventHandler> handlers = new HashSet<SmartCoreEventHandler>();
|
||||
|
||||
public static void Add(SmartCoreEventHandler handler)
|
||||
{
|
||||
handlers.add(handler);
|
||||
}
|
||||
|
||||
public static void Remove(SmartCoreEventHandler handler)
|
||||
{
|
||||
handlers.remove(handler);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void NetHandlerPlayServer_beforeProcessPlayer(NetHandlerPlayServer netServerHandler, C03PacketPlayer packetPlayer)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.beforeProcessPlayer(netServerHandler);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void NetHandlerPlayServer_afterProcessPlayer(NetHandlerPlayServer netServerHandler, C03PacketPlayer packetPlayer)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.afterProcessPlayer(netServerHandler);
|
||||
}
|
||||
|
||||
public static void NetHandlerPlayServer_beforeProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.beforeProcessPlayerBlockPlacement(netServerHandler, packet15place);
|
||||
}
|
||||
|
||||
public static void NetHandlerPlayServer_afterProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.afterProcessPlayerBlockPlacement(netServerHandler, packet15place);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void PlayerControllerMP_beforeOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP, World world, ItemStack itemStack, int integer1, int integer2, int integer3, int integer4, Vec3 vec3)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.beforeOnPlayerRightClick(playerControllerMP, entityPlayerSP);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void PlayerControllerMP_afterOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP, World world, ItemStack itemStack, int integer1, int integer2, int integer3, int integer4, Vec3 vec3)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.afterOnPlayerRightClick(playerControllerMP, entityPlayerSP);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void ItemInWorldManager_beforeActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer, World world, ItemStack itemStack, int integer1, int integer2, int integer3, int integer4, float float1, float float2, float float3)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.beforeActivateBlockOrUseItem(itemInWorldManager, entityPlayer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void ItemInWorldManager_afterActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer, World world, ItemStack itemStack, int integer1, int integer2, int integer3, int integer4, float float1, float float2, float float3)
|
||||
{
|
||||
for(SmartCoreEventHandler eventHandler : handlers)
|
||||
eventHandler.afterActivateBlockOrUseItem(itemInWorldManager, entityPlayer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void beforeProcessPlayer(NetHandlerPlayServer netServerHandler)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void afterProcessPlayer(NetHandlerPlayServer netServerHandler)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void beforeProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void afterProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void beforeOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void afterOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void beforeActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void afterActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
public class SmartCoreInfo
|
||||
{
|
||||
public static final String ModName = "Smart Core";
|
||||
public static final String ModVersion = SmartCorePlugin.Version;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import org.objectweb.asm.*;
|
||||
|
||||
public class SmartCoreMethodVisitor extends MethodVisitor
|
||||
{
|
||||
private final SmartCoreTransformation transformation;
|
||||
|
||||
public SmartCoreMethodVisitor(MethodVisitor paramMethodVisitor, SmartCoreTransformation transformation)
|
||||
{
|
||||
super(262144, paramMethodVisitor);
|
||||
|
||||
this.transformation = transformation;
|
||||
|
||||
invokeHook(transformation.beforeHookMethodName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode)
|
||||
{
|
||||
if(opcode == Opcodes.RETURN || opcode == Opcodes.IRETURN || opcode == Opcodes.LRETURN ||opcode == Opcodes.FRETURN || opcode == Opcodes.DRETURN || opcode == Opcodes.ARETURN)
|
||||
invokeHook(transformation.afterHookMethodName);
|
||||
super.visitInsn(opcode);
|
||||
}
|
||||
|
||||
private void invokeHook(String hookName)
|
||||
{
|
||||
if (hookName == null)
|
||||
return;
|
||||
|
||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||
int offset = 1;
|
||||
for(int i=0; i<transformation.parameterTypeNames.length; i++)
|
||||
{
|
||||
String typeName = transformation.parameterTypeNames[i];
|
||||
mv.visitVarInsn(LoadOpcode(typeName), offset);
|
||||
offset += LoadOffset(typeName);
|
||||
}
|
||||
mv.visitMethodInsn(Opcodes.INVOKESTATIC, transformation.getHookClassDesc(), hookName, transformation.getHookMethodDesc(), false);
|
||||
}
|
||||
|
||||
private static int LoadOpcode(String typeName)
|
||||
{
|
||||
if(typeName.equals(boolean.class.getName()) || typeName.equals(byte.class.getName()) || typeName.equals(short.class.getName()) || typeName.equals(int.class.getName()))
|
||||
return Opcodes.ILOAD;
|
||||
if(typeName.equals(long.class.getName()))
|
||||
return Opcodes.LLOAD;
|
||||
if(typeName.equals(float.class.getName()))
|
||||
return Opcodes.FLOAD;
|
||||
if(typeName.equals(double.class.getName()))
|
||||
return Opcodes.DLOAD;
|
||||
return Opcodes.ALOAD;
|
||||
}
|
||||
|
||||
private static int LoadOffset(String typeName)
|
||||
{
|
||||
if(typeName.equals(long.class.getName()) || typeName.equals(double.class.getName()))
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
public class SmartCorePlugin implements IFMLLoadingPlugin
|
||||
{
|
||||
public static String Version = "1.0.3";
|
||||
|
||||
public static boolean isObfuscated;
|
||||
|
||||
@Override
|
||||
public String[] getASMTransformerClass()
|
||||
{
|
||||
return new String[] { "net.smart.core.SmartCoreTransformer" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccessTransformerClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModContainerClass()
|
||||
{
|
||||
return "net.smart.core.SmartCoreContainer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSetupClass()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data)
|
||||
{
|
||||
isObfuscated = (Boolean)data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SmartCoreTransformation
|
||||
{
|
||||
public final String className;
|
||||
public final String methodName;
|
||||
public final String[] parameterTypeNames;
|
||||
public final String returnType;
|
||||
public final String hookClassName;
|
||||
public final String beforeHookMethodName;
|
||||
public final String afterHookMethodName;
|
||||
|
||||
public SmartCoreTransformation(String className, String methodName, String[] parameterTypeNames, String returnType, String hookClassName, String beforeHookMethodName, String afterHookMethodName)
|
||||
{
|
||||
this.className = className;
|
||||
this.methodName = methodName;
|
||||
this.parameterTypeNames = parameterTypeNames;
|
||||
this.returnType = returnType;
|
||||
this.hookClassName = hookClassName;
|
||||
this.beforeHookMethodName = beforeHookMethodName;
|
||||
this.afterHookMethodName = afterHookMethodName;
|
||||
}
|
||||
|
||||
private static String getDescription(String type)
|
||||
{
|
||||
if(type == null || type == "void")
|
||||
return "V";
|
||||
if(type.endsWith("[]"))
|
||||
return "[" + getDescription(type.substring(0, type.length() - 2));
|
||||
if(type.equals("boolean"))
|
||||
return "Z";
|
||||
if(type.equals("byte"))
|
||||
return "B";
|
||||
if(type.equals("short"))
|
||||
return "S";
|
||||
if(type.equals("int"))
|
||||
return "I";
|
||||
if(type.equals("float"))
|
||||
return "F";
|
||||
if(type.equals("long"))
|
||||
return "J";
|
||||
if(type.equals("double"))
|
||||
return "D";
|
||||
return "L" + type.replace(".", "/") + ";";
|
||||
}
|
||||
|
||||
private static String getDescriptions(String[] parameterTypes)
|
||||
{
|
||||
String result = "";
|
||||
for(int i=0; i<parameterTypes.length; i++)
|
||||
result += getDescription(parameterTypes[i]);
|
||||
return result + "";
|
||||
}
|
||||
|
||||
private static String getMethodDescription(String[] parameterTypes, String resultType)
|
||||
{
|
||||
return "(" + getDescriptions(parameterTypes) + ")" + getDescription(resultType);
|
||||
}
|
||||
|
||||
public String getMethodDesc()
|
||||
{
|
||||
return getMethodDescription(parameterTypeNames, returnType);
|
||||
}
|
||||
|
||||
public String getHookClassDesc()
|
||||
{
|
||||
return hookClassName.replace(".", "/");
|
||||
}
|
||||
|
||||
public String getHookMethodDesc()
|
||||
{
|
||||
List names = new ArrayList();
|
||||
names.add(className);
|
||||
for(int i=0; i<parameterTypeNames.length; i++)
|
||||
names.add(parameterTypeNames[i]);
|
||||
|
||||
String[] result = new String[names.size()];
|
||||
names.toArray(result);
|
||||
return getMethodDescription(result, null);
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.core;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.launchwrapper.*;
|
||||
|
||||
public class SmartCoreTransformer implements IClassTransformer
|
||||
{
|
||||
@Override
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes)
|
||||
{
|
||||
List<SmartCoreTransformation> list = null;
|
||||
for(SmartCoreTransformation transformation : _transformations)
|
||||
if(transformedName.equals(transformation.className))
|
||||
(list == null ? (list = new ArrayList<SmartCoreTransformation>()) : list).add(transformation);
|
||||
|
||||
if(list != null)
|
||||
return SmartCoreClassVisitor.transform(bytes, list);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
private static final SmartCoreTransformation[] _transformations = new SmartCoreTransformation[]
|
||||
{
|
||||
new SmartCoreTransformation
|
||||
(
|
||||
"net.minecraft.network.NetHandlerPlayServer",
|
||||
Name("processPlayer", "a"),
|
||||
new String[]
|
||||
{
|
||||
Name("net.minecraft.network.play.client.C03PacketPlayer", "jd")
|
||||
},
|
||||
null,
|
||||
"net.smart.core.SmartCoreEventHandler",
|
||||
"NetHandlerPlayServer_beforeProcessPlayer",
|
||||
"NetHandlerPlayServer_afterProcessPlayer"
|
||||
),
|
||||
new SmartCoreTransformation
|
||||
(
|
||||
"net.minecraft.network.NetHandlerPlayServer",
|
||||
Name("processPlayerBlockPlacement", "a"),
|
||||
new String[]
|
||||
{
|
||||
Name("net.minecraft.network.play.client.C08PacketPlayerBlockPlacement", "jo")
|
||||
},
|
||||
null,
|
||||
"net.smart.core.SmartCoreEventHandler",
|
||||
"NetHandlerPlayServer_beforeProcessPlayerBlockPlacement",
|
||||
"NetHandlerPlayServer_afterProcessPlayerBlockPlacement"
|
||||
),
|
||||
new SmartCoreTransformation
|
||||
(
|
||||
Name("net.minecraft.client.multiplayer.PlayerControllerMP", "bje"),
|
||||
Name("onPlayerRightClick", "a"),
|
||||
new String[]
|
||||
{
|
||||
Name("net.minecraft.entity.player.EntityPlayer", "yz"),
|
||||
Name("net.minecraft.world.World", "ahb"),
|
||||
Name("net.minecraft.item.ItemStack", "add"),
|
||||
"int",
|
||||
"int",
|
||||
"int",
|
||||
"int",
|
||||
Name("net.minecraft.util.Vec3", "azw")
|
||||
},
|
||||
"boolean",
|
||||
"net.smart.core.SmartCoreEventHandler",
|
||||
"PlayerControllerMP_beforeOnPlayerRightClick",
|
||||
"PlayerControllerMP_afterOnPlayerRightClick"
|
||||
),
|
||||
new SmartCoreTransformation
|
||||
(
|
||||
Name("net.minecraft.server.management.ItemInWorldManager", "qx"),
|
||||
Name("activateBlockOrUseItem", "a"),
|
||||
new String[]
|
||||
{
|
||||
Name("net.minecraft.entity.player.EntityPlayer", "yz"),
|
||||
Name("net.minecraft.world.World", "ahb"),
|
||||
Name("net.minecraft.item.ItemStack", "add"),
|
||||
"int",
|
||||
"int",
|
||||
"int",
|
||||
"int",
|
||||
"float",
|
||||
"float",
|
||||
"float"
|
||||
},
|
||||
"boolean",
|
||||
"net.smart.core.SmartCoreEventHandler",
|
||||
"ItemInWorldManager_beforeActivateBlockOrUseItem",
|
||||
"ItemInWorldManager_afterActivateBlockOrUseItem"
|
||||
)
|
||||
};
|
||||
|
||||
private static String Name(String deobfuscated, String obfuscated)
|
||||
{
|
||||
return SmartCorePlugin.isObfuscated ? obfuscated : deobfuscated;
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.gui.*;
|
||||
import net.minecraft.client.settings.*;
|
||||
|
||||
public class Button extends SmartMovingContext
|
||||
{
|
||||
public boolean Pressed;
|
||||
public boolean WasPressed;
|
||||
|
||||
public boolean StartPressed;
|
||||
public boolean StopPressed;
|
||||
|
||||
public void update(KeyBinding binding)
|
||||
{
|
||||
update(Minecraft.getMinecraft().inGameHasFocus && isKeyDown(binding));
|
||||
}
|
||||
|
||||
public void update(int keyCode)
|
||||
{
|
||||
update(Minecraft.getMinecraft().inGameHasFocus && isKeyDown(keyCode));
|
||||
}
|
||||
|
||||
public void update(boolean pressed)
|
||||
{
|
||||
WasPressed = Pressed;
|
||||
Pressed = pressed;
|
||||
|
||||
StartPressed = !WasPressed && Pressed;
|
||||
StopPressed = WasPressed && !Pressed;
|
||||
}
|
||||
|
||||
private static boolean isKeyDown(KeyBinding keyBinding)
|
||||
{
|
||||
return isKeyDown(keyBinding, keyBinding.isPressed());
|
||||
}
|
||||
|
||||
private static boolean isKeyDown(KeyBinding keyBinding, boolean wasDown)
|
||||
{
|
||||
GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
|
||||
if(currentScreen == null || currentScreen.allowUserInput)
|
||||
return isKeyDown(keyBinding.getKeyCode());
|
||||
return wasDown;
|
||||
}
|
||||
|
||||
private static boolean isKeyDown(int keyCode)
|
||||
{
|
||||
if(keyCode >= 0)
|
||||
return Keyboard.isKeyDown(keyCode);
|
||||
return Mouse.isButtonDown(keyCode + 100);
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
|
||||
public class ClimbGap
|
||||
{
|
||||
public Block Block;
|
||||
public int Meta;
|
||||
public boolean CanStand;
|
||||
public boolean MustCrawl;
|
||||
public Orientation Direction;
|
||||
public boolean SkipGaps;
|
||||
|
||||
public ClimbGap()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
public void reset()
|
||||
{
|
||||
Block = null;
|
||||
Meta = -1;
|
||||
CanStand = false;
|
||||
MustCrawl = false;
|
||||
Direction = null;
|
||||
SkipGaps = false;
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class FeetClimbing
|
||||
{
|
||||
public static final int DownStep = 1;
|
||||
public static final int NoStep = 0;
|
||||
|
||||
public static FeetClimbing None = new FeetClimbing(-3);
|
||||
public static FeetClimbing BaseHold = new FeetClimbing(-2);
|
||||
public static FeetClimbing BaseWithHands = new FeetClimbing(-1);
|
||||
public static FeetClimbing TopWithHands = new FeetClimbing(0);
|
||||
public static FeetClimbing SlowUpWithHoldWithoutHands = new FeetClimbing(1);
|
||||
public static FeetClimbing SlowUpWithSinkWithoutHands = new FeetClimbing(2);
|
||||
public static FeetClimbing FastUp = new FeetClimbing(3);
|
||||
|
||||
private int _value;
|
||||
|
||||
private FeetClimbing(int value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
public boolean IsRelevant()
|
||||
{
|
||||
return _value > None._value;
|
||||
}
|
||||
|
||||
public boolean IsIndependentlyRelevant()
|
||||
{
|
||||
return _value > BaseWithHands._value;
|
||||
}
|
||||
|
||||
public boolean IsUp()
|
||||
{
|
||||
return this == SlowUpWithHoldWithoutHands || this == SlowUpWithSinkWithoutHands || this == FastUp;
|
||||
}
|
||||
|
||||
public FeetClimbing max(FeetClimbing other, ClimbGap inout_thisClimbGap, ClimbGap otherClimbGap)
|
||||
{
|
||||
if(!otherClimbGap.SkipGaps)
|
||||
{
|
||||
inout_thisClimbGap.CanStand |= otherClimbGap.CanStand;
|
||||
inout_thisClimbGap.MustCrawl |= otherClimbGap.MustCrawl;
|
||||
}
|
||||
if(_value < other._value)
|
||||
{
|
||||
inout_thisClimbGap.Block = otherClimbGap.Block;
|
||||
inout_thisClimbGap.Meta = otherClimbGap.Meta;
|
||||
inout_thisClimbGap.Direction = otherClimbGap.Direction;
|
||||
}
|
||||
return get(Math.max(_value, other._value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if(_value <= None._value)
|
||||
return "None";
|
||||
if(_value == BaseHold._value)
|
||||
return "BaseHold";
|
||||
if(_value == BaseWithHands._value)
|
||||
return "BaseWithHands";
|
||||
if(_value == TopWithHands._value)
|
||||
return "TopWithHands";
|
||||
if(_value == SlowUpWithHoldWithoutHands._value)
|
||||
return "SlowUpWithHoldWithoutHands";
|
||||
if(_value == SlowUpWithSinkWithoutHands._value)
|
||||
return "SlowUpWithSinkWithoutHands";
|
||||
return "FastUp";
|
||||
}
|
||||
|
||||
public void print(String name)
|
||||
{
|
||||
PrintStream stream = System.err;
|
||||
if(name != null)
|
||||
stream.print(name + " = ");
|
||||
stream.println(this);
|
||||
}
|
||||
|
||||
private static FeetClimbing get(int value)
|
||||
{
|
||||
if(value <= None._value)
|
||||
return None;
|
||||
if(value == BaseHold._value)
|
||||
return BaseHold;
|
||||
if(value == BaseWithHands._value)
|
||||
return BaseWithHands;
|
||||
if(value == TopWithHands._value)
|
||||
return TopWithHands;
|
||||
if(value == SlowUpWithHoldWithoutHands._value)
|
||||
return SlowUpWithHoldWithoutHands;
|
||||
if(value == SlowUpWithSinkWithoutHands._value)
|
||||
return SlowUpWithSinkWithoutHands;
|
||||
return FastUp;
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class HandsClimbing
|
||||
{
|
||||
public static final int MiddleGrab = 2;
|
||||
public static final int UpGrab = 1;
|
||||
public static final int NoGrab = 0;
|
||||
|
||||
public static HandsClimbing None = new HandsClimbing(-3);
|
||||
public static HandsClimbing Sink = new HandsClimbing(-2);
|
||||
public static HandsClimbing TopHold = new HandsClimbing(-1);
|
||||
public static HandsClimbing BottomHold = new HandsClimbing(0);
|
||||
public static HandsClimbing Up = new HandsClimbing(1);
|
||||
public static HandsClimbing FastUp = new HandsClimbing(2);
|
||||
|
||||
private int _value;
|
||||
|
||||
private HandsClimbing(int value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
public boolean IsRelevant()
|
||||
{
|
||||
return _value > None._value;
|
||||
}
|
||||
|
||||
public boolean IsUp()
|
||||
{
|
||||
return this == Up || this == FastUp;
|
||||
}
|
||||
|
||||
public HandsClimbing ToUp()
|
||||
{
|
||||
if(this == BottomHold)
|
||||
return Up;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HandsClimbing ToDown()
|
||||
{
|
||||
if(this == TopHold)
|
||||
return Sink;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HandsClimbing max(HandsClimbing other, ClimbGap inout_thisClimbGap, ClimbGap otherClimbGap)
|
||||
{
|
||||
if(!otherClimbGap.SkipGaps)
|
||||
{
|
||||
inout_thisClimbGap.CanStand |= otherClimbGap.CanStand;
|
||||
inout_thisClimbGap.MustCrawl |= otherClimbGap.MustCrawl;
|
||||
}
|
||||
if(_value < other._value)
|
||||
{
|
||||
inout_thisClimbGap.Block = otherClimbGap.Block;
|
||||
inout_thisClimbGap.Meta = otherClimbGap.Meta;
|
||||
inout_thisClimbGap.Direction = otherClimbGap.Direction;
|
||||
}
|
||||
return get(Math.max(_value, other._value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if(_value <= None._value)
|
||||
return "None";
|
||||
if(_value == Sink._value)
|
||||
return "Sink";
|
||||
if(_value == BottomHold._value)
|
||||
return "BottomHold";
|
||||
if(_value == TopHold._value)
|
||||
return "TopHold";
|
||||
if(_value == Up._value)
|
||||
return "Up";
|
||||
return "FastUp";
|
||||
}
|
||||
|
||||
public void print(String name)
|
||||
{
|
||||
PrintStream stream = System.err;
|
||||
if(name != null)
|
||||
stream.print(name + " = ");
|
||||
stream.println(this);
|
||||
}
|
||||
|
||||
private static HandsClimbing get(int value)
|
||||
{
|
||||
if(value <= None._value)
|
||||
return None;
|
||||
if(value == Sink._value)
|
||||
return Sink;
|
||||
if(value == BottomHold._value)
|
||||
return BottomHold;
|
||||
if(value == TopHold._value)
|
||||
return TopHold;
|
||||
if(value == Up._value)
|
||||
return Up;
|
||||
return FastUp;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
public interface IEntityPlayerMP extends IPacketSender
|
||||
{
|
||||
void sendPacketToTrackedPlayers(FMLProxyPacket packet);
|
||||
|
||||
String getUsername();
|
||||
|
||||
void resetFallDistance();
|
||||
|
||||
void resetTicksForFloatKick();
|
||||
|
||||
void setHeight(float height);
|
||||
|
||||
double getMinY();
|
||||
|
||||
float getHeight();
|
||||
|
||||
void setMaxY(double maxY);
|
||||
|
||||
boolean localIsEntityInsideOpaqueBlock();
|
||||
|
||||
SmartMovingServer getMoving();
|
||||
|
||||
IEntityPlayerMP[] getAllPlayers();
|
||||
|
||||
float doGetHealth();
|
||||
|
||||
AxisAlignedBB getBox();
|
||||
|
||||
AxisAlignedBB expandBox(AxisAlignedBB box, double x, double y, double z);
|
||||
|
||||
List<?> getEntitiesExcludingPlayer(AxisAlignedBB box);
|
||||
|
||||
boolean isDeadEntity(Entity entity);
|
||||
|
||||
void onCollideWithPlayer(Entity entity);
|
||||
|
||||
void localAddExhaustion(float exhaustion);
|
||||
|
||||
void localAddMovementStat(double x, double y, double z);
|
||||
|
||||
void localPlaySound(String soundId, float volume, float pitch);
|
||||
|
||||
boolean localIsSneaking();
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.entity.player.EntityPlayer.*;
|
||||
import net.minecraft.nbt.*;
|
||||
|
||||
public interface IEntityPlayerSP
|
||||
{
|
||||
SmartMoving getMoving();
|
||||
|
||||
boolean getSleepingField();
|
||||
|
||||
boolean getIsJumpingField();
|
||||
|
||||
boolean getIsInWebField();
|
||||
|
||||
void setIsInWebField(boolean b);
|
||||
|
||||
Minecraft getMcField();
|
||||
|
||||
void setMoveForwardField(float f);
|
||||
|
||||
void setMoveStrafingField(float f);
|
||||
|
||||
void setIsJumpingField(boolean flag);
|
||||
|
||||
void localMoveEntity(double d, double d1, double d2);
|
||||
|
||||
EnumStatus localSleepInBedAt(int i, int j, int k);
|
||||
|
||||
float localGetBrightness(float f);
|
||||
|
||||
int localGetBrightnessForRender(float f);
|
||||
|
||||
void localUpdateEntityActionState();
|
||||
|
||||
boolean localIsInsideOfMaterial(Material material);
|
||||
|
||||
void localWriteEntityToNBT(NBTTagCompound nBTTagCompound);
|
||||
|
||||
boolean localIsSneaking();
|
||||
|
||||
float localGetFOVMultiplier();
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
public interface ILocalUserNameProvider
|
||||
{
|
||||
String getLocalConfigUserName();
|
||||
|
||||
String getLocalSpeedUserName();
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
|
||||
public interface IPacketReceiver
|
||||
{
|
||||
boolean processStatePacket(FMLProxyPacket packet, IEntityPlayerMP player, int entityId, long state);
|
||||
|
||||
boolean processConfigInfoPacket(FMLProxyPacket packet, IEntityPlayerMP player, String info);
|
||||
|
||||
boolean processConfigContentPacket(FMLProxyPacket packet, IEntityPlayerMP player, String[] content, String username);
|
||||
|
||||
boolean processConfigChangePacket(FMLProxyPacket packet, IEntityPlayerMP player);
|
||||
|
||||
boolean processSpeedChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, int difference, String username);
|
||||
|
||||
boolean processHungerChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, float hunger);
|
||||
|
||||
boolean processSoundPacket(FMLProxyPacket packet, IEntityPlayerMP player, String soundId, float distance, float pitch);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
public interface IPacketSender
|
||||
{
|
||||
void sendPacket(byte[] byteArray);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
public interface ISmartMovingClient
|
||||
{
|
||||
float getMaximumExhaustion();
|
||||
|
||||
float getMaximumUpJumpCharge();
|
||||
|
||||
float getMaximumHeadJumpCharge();
|
||||
|
||||
void setMaximumExhaustionValue(String key, float value);
|
||||
|
||||
float getMaximumExhaustionValue(String key);
|
||||
|
||||
boolean removeMaximumExhaustionValue(String key);
|
||||
|
||||
void setNativeUserInterfaceDrawing(boolean value);
|
||||
|
||||
boolean getNativeUserInterfaceDrawing();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
public interface ISmartMovingSelf
|
||||
{
|
||||
float getExhaustion();
|
||||
|
||||
float getUpJumpCharge();
|
||||
|
||||
float getHeadJumpCharge();
|
||||
|
||||
void addExhaustion(float factor);
|
||||
|
||||
void setMaxExhaustionForAction(float maxExhaustionForAction);
|
||||
|
||||
void setMaxExhaustionToStartAction(float maxExhaustionToStartAction);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.client.*;
|
||||
|
||||
public class LocalUserNameProvider extends SmartMovingContext implements ILocalUserNameProvider
|
||||
{
|
||||
@Override
|
||||
public String getLocalConfigUserName()
|
||||
{
|
||||
return Options._localUserHasChangeConfigRight.value ? Minecraft.getMinecraft().thePlayer.getGameProfile().getName() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalSpeedUserName()
|
||||
{
|
||||
return Options._localUserHasChangeSpeedRight.value ? Minecraft.getMinecraft().thePlayer.getGameProfile().getName() : null;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,157 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.particle.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
public abstract class SmartMoving extends SmartMovingBase
|
||||
{
|
||||
public boolean isSlow;
|
||||
public boolean isFast;
|
||||
|
||||
public boolean isClimbing;
|
||||
public boolean isHandsVineClimbing;
|
||||
public boolean isFeetVineClimbing;
|
||||
|
||||
public boolean isClimbJumping;
|
||||
public boolean isClimbBackJumping;
|
||||
public boolean isWallJumping;
|
||||
public boolean isClimbCrawling;
|
||||
public boolean isCrawlClimbing;
|
||||
public boolean isCeilingClimbing;
|
||||
public boolean isRopeSliding;
|
||||
|
||||
public boolean isDipping;
|
||||
public boolean isSwimming;
|
||||
public boolean isDiving;
|
||||
public boolean isLevitating;
|
||||
public boolean isHeadJumping;
|
||||
public boolean isCrawling;
|
||||
public boolean isSliding;
|
||||
public boolean isFlying;
|
||||
|
||||
public int actualHandsClimbType;
|
||||
public int actualFeetClimbType;
|
||||
|
||||
public int angleJumpType;
|
||||
|
||||
public float heightOffset;
|
||||
|
||||
private float spawnSlindingParticle;
|
||||
private float spawnSwimmingParticle;
|
||||
|
||||
public SmartMoving(EntityPlayer sp, IEntityPlayerSP isp)
|
||||
{
|
||||
super(sp, isp);
|
||||
}
|
||||
|
||||
public boolean isAngleJumping()
|
||||
{
|
||||
return angleJumpType > 1 && angleJumpType < 7;
|
||||
}
|
||||
|
||||
public abstract boolean isJumping();
|
||||
|
||||
public abstract boolean doFlyingAnimation();
|
||||
|
||||
public abstract boolean doFallingAnimation();
|
||||
|
||||
protected void spawnParticles(Minecraft minecraft, double playerMotionX, double playerMotionZ)
|
||||
{
|
||||
float horizontalSpeedSquare = 0;
|
||||
if(isSliding || isSwimming)
|
||||
horizontalSpeedSquare = (float)(playerMotionX * playerMotionX + playerMotionZ * playerMotionZ);
|
||||
|
||||
if(isSliding)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int j = MathHelper.floor_double(sp.boundingBox.minY - 0.1F);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
Block block = sp.worldObj.getBlock(i, j, k);
|
||||
if(block != null)
|
||||
{
|
||||
double posY = sp.boundingBox.minY + 0.1D;
|
||||
double motionX = -playerMotionX * 4D;
|
||||
double motionY = 1.5D;
|
||||
double motionZ = -playerMotionZ * 4D;
|
||||
|
||||
spawnSlindingParticle += horizontalSpeedSquare;
|
||||
|
||||
float maxSpawnSlindingParticle = Config._slideParticlePeriodFactor.value * 0.1F;
|
||||
while(spawnSlindingParticle > maxSpawnSlindingParticle)
|
||||
{
|
||||
double posX = sp.posX + getSpawnOffset();
|
||||
double posZ = sp.posZ + getSpawnOffset();
|
||||
int metaData = sp.worldObj.getBlockMetadata(i, j, k);
|
||||
sp.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(block) + "_" + metaData, posX, posY, posZ, motionX, motionY, motionZ);
|
||||
spawnSlindingParticle -= maxSpawnSlindingParticle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isSwimming)
|
||||
{
|
||||
float posY = MathHelper.floor_double(sp.boundingBox.minY) + 1.0F;
|
||||
int i = (int)Math.floor(sp.posX);
|
||||
int j = (int)Math.floor(posY - 0.5);
|
||||
int k = (int)Math.floor(sp.posZ);
|
||||
|
||||
Block block = sp.worldObj.getBlock(i, j, k);
|
||||
|
||||
boolean isLava = block != null && isLava(block);
|
||||
spawnSwimmingParticle += horizontalSpeedSquare;
|
||||
|
||||
float maxSpawnSwimmingParticle = (isLava ? Config._lavaSwimParticlePeriodFactor.value : Config._swimParticlePeriodFactor.value) * 0.01F;
|
||||
while(spawnSwimmingParticle > maxSpawnSwimmingParticle)
|
||||
{
|
||||
double posX = sp.posX + getSpawnOffset();
|
||||
double posZ = sp.posZ + getSpawnOffset();
|
||||
EntityFX splash = isLava ? new EntityLavaFX(sp.worldObj, posX, posY, posZ) : new EntitySplashFX(sp.worldObj, posX, posY, posZ, 0, 0, 0);
|
||||
splash.motionX = 0;
|
||||
splash.motionY = 0.2;
|
||||
splash.motionZ = 0;
|
||||
minecraft.effectRenderer.addEffect(splash);
|
||||
|
||||
spawnSwimmingParticle -= maxSpawnSwimmingParticle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float getSpawnOffset()
|
||||
{
|
||||
return (sp.getRNG().nextFloat() - 0.5F) * 2F * sp.width;
|
||||
}
|
||||
|
||||
protected void onStartClimbBackJump()
|
||||
{
|
||||
net.smart.render.SmartRenderRender.getPreviousRendererData(sp).rotateAngleY += isHeadJumping ? Half : Quarter;
|
||||
isClimbBackJumping = true;
|
||||
}
|
||||
|
||||
protected void onStartWallJump(Float angle)
|
||||
{
|
||||
if (angle != null)
|
||||
net.smart.render.SmartRenderRender.getPreviousRendererData(sp).rotateAngleY = angle / RadiantToAngle;
|
||||
isWallJumping = true;
|
||||
sp.fallDistance = 0F;
|
||||
}
|
||||
}
|
||||
@@ -1,933 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
import net.smart.moving.config.*;
|
||||
|
||||
public abstract class SmartMovingBase extends SmartMovingContext
|
||||
{
|
||||
public final EntityPlayer sp;
|
||||
public final EntityPlayerSP esp;
|
||||
public final IEntityPlayerSP isp;
|
||||
|
||||
public SmartMovingBase(EntityPlayer sp, IEntityPlayerSP isp)
|
||||
{
|
||||
this.sp = sp;
|
||||
this.isp = isp;
|
||||
|
||||
if (sp instanceof EntityPlayerSP)
|
||||
{
|
||||
esp = (EntityPlayerSP) sp;
|
||||
if(Minecraft.getMinecraft().thePlayer == null)
|
||||
{
|
||||
Options.resetForNewGame();
|
||||
Config = Options;
|
||||
}
|
||||
}
|
||||
else
|
||||
esp = null;
|
||||
}
|
||||
|
||||
protected void moveFlying(float moveUpward, float moveStrafing, float moveForward, float speedFactor, boolean treeDimensional)
|
||||
{
|
||||
float diffMotionXStrafing = 0, diffMotionXForward = 0, diffMotionZStrafing = 0, diffMotionZForward = 0;
|
||||
{
|
||||
float total = MathHelper.sqrt_float(moveStrafing * moveStrafing + moveForward * moveForward);
|
||||
if(total >= 0.01F)
|
||||
{
|
||||
if(total < 1.0F)
|
||||
total = 1.0F;
|
||||
|
||||
float moveStrafingFactor = moveStrafing / total;
|
||||
float moveForwardFactor = moveForward / total;
|
||||
float sin = MathHelper.sin((sp.rotationYaw * 3.141593F) / 180F);
|
||||
float cos = MathHelper.cos((sp.rotationYaw * 3.141593F) / 180F);
|
||||
diffMotionXStrafing = moveStrafingFactor * cos;
|
||||
diffMotionXForward = -moveForwardFactor * sin;
|
||||
diffMotionZStrafing = moveStrafingFactor * sin;
|
||||
diffMotionZForward = moveForwardFactor * cos;
|
||||
}
|
||||
}
|
||||
|
||||
float rotation = treeDimensional ? sp.rotationPitch / RadiantToAngle : 0;
|
||||
float divingHorizontalFactor = MathHelper.cos(rotation);
|
||||
float divingVerticalFactor = -MathHelper.sin(rotation) * Math.signum(moveForward);
|
||||
|
||||
float diffMotionX = diffMotionXForward * divingHorizontalFactor + diffMotionXStrafing;
|
||||
float diffMotionY = MathHelper.sqrt_float(diffMotionXForward * diffMotionXForward + diffMotionZForward * diffMotionZForward) * divingVerticalFactor + moveUpward;
|
||||
float diffMotionZ = diffMotionZForward * divingHorizontalFactor + diffMotionZStrafing;
|
||||
|
||||
float total = MathHelper.sqrt_float(MathHelper.sqrt_float(diffMotionX * diffMotionX + diffMotionZ * diffMotionZ) + diffMotionY * diffMotionY);
|
||||
if(total > 0.01F)
|
||||
{
|
||||
float factor = speedFactor / total;
|
||||
sp.motionX += diffMotionX * factor;
|
||||
sp.motionY += diffMotionY * factor;
|
||||
sp.motionZ += diffMotionZ * factor;
|
||||
}
|
||||
}
|
||||
|
||||
protected Block supportsCeilingClimbing(int i, int j, int k)
|
||||
{
|
||||
Block block = sp.worldObj.getBlock(i, j, k);
|
||||
if(block == null)
|
||||
return null;
|
||||
|
||||
Dictionary<Object,Set<Integer>> configuration = Config._ceilingClimbConfigurationObject.value;
|
||||
Set<Integer> metaDatas = configuration.get(block);
|
||||
if(metaDatas == null)
|
||||
{
|
||||
String blockName = block.getUnlocalizedName();
|
||||
if (blockName != null && !blockName.isEmpty())
|
||||
{
|
||||
metaDatas = configuration.get(blockName);
|
||||
if(metaDatas == null && blockName.startsWith("tile.") && blockName.length() > 5)
|
||||
metaDatas = configuration.get(blockName.substring(5));
|
||||
}
|
||||
}
|
||||
|
||||
if(metaDatas == null)
|
||||
return null;
|
||||
if(metaDatas.isEmpty())
|
||||
return block;
|
||||
if(metaDatas.contains(sp.worldObj.getBlockMetadata(i, j, k)))
|
||||
return block;
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
protected boolean isLava(Block block)
|
||||
{
|
||||
if(block == Block.getBlockFromName("lava") || block == Block.getBlockFromName("flowing_lava"))
|
||||
return true;
|
||||
return block != null && block.getMaterial() == Material.lava;
|
||||
}
|
||||
|
||||
protected float getLiquidBorder(int i, int j, int k)
|
||||
{
|
||||
float finiteLiquidBorder;
|
||||
Block block = sp.worldObj.getBlock(i, j, k);
|
||||
if(block == Block.getBlockFromName("water") || block == Block.getBlockFromName("flowing_water"))
|
||||
return getNormalWaterBorder(i, j, k);
|
||||
if(SmartMovingOptions.hasFiniteLiquid && (finiteLiquidBorder = getFiniteLiquidWaterBorder(i, j, k, block)) > 0)
|
||||
return finiteLiquidBorder;
|
||||
if(block == Block.getBlockFromName("lava") || block == Block.getBlockFromName("flowing_lava"))
|
||||
return Config._lavaLikeWater.value ? getNormalWaterBorder(i, j, k) : 0F;
|
||||
|
||||
Material material = sp.worldObj.getBlock(i, j, k).getMaterial();
|
||||
if(material == null || material == Material.lava)
|
||||
return Config._lavaLikeWater.value ? 1F : 0F;
|
||||
if(material == Material.water)
|
||||
return getNormalWaterBorder(i, j, k);
|
||||
if(material.isLiquid())
|
||||
return 1F;
|
||||
|
||||
return 0F;
|
||||
}
|
||||
|
||||
protected float getNormalWaterBorder(int i, int j, int k)
|
||||
{
|
||||
int blockMetaData = sp.worldObj.getBlockMetadata(i, j, k);
|
||||
if(blockMetaData >= 8)
|
||||
return 1F;
|
||||
if(blockMetaData == 0)
|
||||
if(sp.worldObj.isAirBlock(i, j + 1, k))
|
||||
return 0.8875F;
|
||||
else
|
||||
return 1F;
|
||||
return (8 - blockMetaData) / 8F;
|
||||
}
|
||||
|
||||
protected float getFiniteLiquidWaterBorder(int i, int j, int k, Block block)
|
||||
{
|
||||
int type;
|
||||
if((type = Orientation.getFiniteLiquidWater(block)) > 0)
|
||||
{
|
||||
if(type == 2)
|
||||
return 1F;
|
||||
if(type == 1)
|
||||
{
|
||||
Block aboveBlock = sp.worldObj.getBlock(i, j + 1, k);
|
||||
if(Orientation.getFiniteLiquidWater(aboveBlock) > 0)
|
||||
return 1F;
|
||||
return (sp.worldObj.getBlockMetadata(i, j, k) + 1) / 16F;
|
||||
}
|
||||
}
|
||||
return 0F;
|
||||
}
|
||||
|
||||
public boolean isFacedToLadder(boolean isSmall)
|
||||
{
|
||||
return getOnLadder(1, true, isSmall) > 0;
|
||||
}
|
||||
|
||||
public boolean isFacedToSolidVine(boolean isSmall)
|
||||
{
|
||||
return getOnVine(1, true, isSmall) > 0;
|
||||
}
|
||||
|
||||
public boolean isOnLadderOrVine(boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(1, false, isSmall) > 0;
|
||||
}
|
||||
|
||||
public boolean isOnVine(boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(1, false, false, true, isSmall) > 0;
|
||||
}
|
||||
|
||||
public boolean isOnLadder(boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(1, false, true, false, isSmall) > 0;
|
||||
}
|
||||
|
||||
protected int getOnLadder(int maxResult, boolean faceOnly, boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(maxResult, faceOnly, true, false, isSmall);
|
||||
}
|
||||
|
||||
protected int getOnVine(int maxResult, boolean faceOnly, boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(maxResult, faceOnly, false, true, isSmall);
|
||||
}
|
||||
|
||||
protected int getOnLadderOrVine(int maxResult, boolean faceOnly, boolean isSmall)
|
||||
{
|
||||
return getOnLadderOrVine(maxResult, faceOnly, true, true, isSmall);
|
||||
}
|
||||
|
||||
protected int getOnLadderOrVine(int maxResult, boolean faceOnly, boolean ladder, boolean vine, boolean isSmall)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int minj = MathHelper.floor_double(sp.boundingBox.minY);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
|
||||
if(Config.isStandardBaseClimb())
|
||||
{
|
||||
Block block = sp.worldObj.getBlock(i, minj, k);
|
||||
if(ladder)
|
||||
if(vine)
|
||||
return Orientation.isClimbable(sp.worldObj, i, minj, k) ? 1 : 0;
|
||||
else
|
||||
return block != Block.getBlockFromName("vine") && Orientation.isClimbable(sp.worldObj, i, minj, k) ? 1 : 0;
|
||||
else
|
||||
if(vine)
|
||||
return block == Block.getBlockFromName("vine") && Orientation.isClimbable(sp.worldObj, i, minj, k) ? 1 : 0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isSmall)
|
||||
minj--;
|
||||
|
||||
HashSet<Orientation> facedOnlyTo = null;
|
||||
if(faceOnly)
|
||||
facedOnlyTo = Orientation.getClimbingOrientations(sp, true, false);
|
||||
|
||||
int result = 0;
|
||||
int maxj = MathHelper.floor_double(sp.boundingBox.minY + Math.ceil(sp.boundingBox.maxY - sp.boundingBox.minY)) - 1;
|
||||
for(int j = minj; j <= maxj; j++)
|
||||
{
|
||||
Block block = sp.worldObj.getBlock(i, j, k);
|
||||
if(ladder)
|
||||
{
|
||||
boolean localLadder = Orientation.isKnownLadder(block);
|
||||
Orientation localLadderOrientation = null;
|
||||
if(localLadder)
|
||||
{
|
||||
localLadderOrientation = Orientation.getKnownLadderOrientation(sp.worldObj, i, j, k);
|
||||
if(facedOnlyTo == null || facedOnlyTo.contains(localLadderOrientation))
|
||||
result++;
|
||||
}
|
||||
|
||||
for(Orientation direction : facedOnlyTo != null ? facedOnlyTo : Orientation.Orthogonals)
|
||||
{
|
||||
if(result >= maxResult)
|
||||
return result;
|
||||
|
||||
if(direction != localLadderOrientation)
|
||||
{
|
||||
Block remoteBlock = sp.worldObj.getBlock(i + direction._i, j, k + direction._k);
|
||||
if(Orientation.isKnownLadder(remoteBlock))
|
||||
{
|
||||
Orientation remoteLadderOrientation = Orientation.getKnownLadderOrientation(sp.worldObj, i + direction._i, j, k + direction._k);
|
||||
if(remoteLadderOrientation.rotate(180) == direction)
|
||||
result++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(result >= maxResult)
|
||||
return result;
|
||||
|
||||
if(vine && Orientation.isVine(block))
|
||||
if(facedOnlyTo == null)
|
||||
result++;
|
||||
else
|
||||
{
|
||||
Iterator<Orientation> iterator = facedOnlyTo.iterator();
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
Orientation climbOrientation = iterator.next();
|
||||
if(climbOrientation.hasVineOrientation(sp.worldObj, i, j, k) && climbOrientation.isRemoteSolid(sp.worldObj, i, j, k))
|
||||
{
|
||||
result++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(result >= maxResult)
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean climbingUpIsBlockedByLadder()
|
||||
{
|
||||
if(sp.isCollidedHorizontally && sp.isCollidedVertically && !sp.onGround && esp.movementInput.moveForward > 0F)
|
||||
{
|
||||
Orientation orientation = Orientation.getOrientation(sp, 20F, true, false);
|
||||
if(orientation != null)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int j = MathHelper.floor_double(sp.boundingBox.maxY);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
if(Orientation.isLadder(sp.worldObj.getBlock(i, j, k)))
|
||||
return Orientation.getKnownLadderOrientation(sp.worldObj, i, j, k) == orientation;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean climbingUpIsBlockedByTrapDoor()
|
||||
{
|
||||
if(sp.isCollidedHorizontally && sp.isCollidedVertically && !sp.onGround && esp.movementInput.moveForward > 0F)
|
||||
{
|
||||
Orientation orientation = Orientation.getOrientation(sp, 20F, true, false);
|
||||
if(orientation != null)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int j = MathHelper.floor_double(sp.boundingBox.maxY);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
if(Orientation.isTrapDoor(sp.worldObj.getBlock(i, j, k)))
|
||||
return Orientation.getOpenTrapDoorOrientation(sp.worldObj, i, j, k) == orientation;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean climbingUpIsBlockedByCobbleStoneWall()
|
||||
{
|
||||
if(sp.isCollidedHorizontally && sp.isCollidedVertically && !sp.onGround && esp.movementInput.moveForward > 0F)
|
||||
{
|
||||
Orientation orientation = Orientation.getOrientation(sp, 20F, true, false);
|
||||
if(orientation != null)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int j = MathHelper.floor_double(sp.boundingBox.maxY);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
if(sp.worldObj.getBlock(i, j, k) == Block.getBlockFromName("cobblestone_wall"))
|
||||
return !((BlockWall)Block.getBlockFromName("cobblestone_wall")).canConnectWallTo(sp.worldObj, i - orientation._i, j, k - orientation._k);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<?> getPlayerSolidBetween(double yMin, double yMax, double horizontalTolerance)
|
||||
{
|
||||
double minY = sp.boundingBox.minY;
|
||||
double maxY = sp.boundingBox.maxY;
|
||||
sp.boundingBox.minY = yMin;
|
||||
sp.boundingBox.maxY = yMax;
|
||||
|
||||
List<?> result = sp.worldObj.getCollidingBoundingBoxes(sp, horizontalTolerance == 0 ? sp.boundingBox : sp.boundingBox.contract(-horizontalTolerance, 0, -horizontalTolerance));
|
||||
|
||||
sp.boundingBox.minY = minY;
|
||||
sp.boundingBox.maxY = maxY;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected boolean isPlayerInSolidBetween(double yMin, double yMax)
|
||||
{
|
||||
return getPlayerSolidBetween(yMin, yMax, 0).size() > 0;
|
||||
}
|
||||
|
||||
protected double getMaxPlayerSolidBetween(double yMin, double yMax, double horizontalTolerance)
|
||||
{
|
||||
List<?> solids = getPlayerSolidBetween(yMin, yMax, horizontalTolerance);
|
||||
double result = yMin;
|
||||
for(int i = 0; i < solids.size(); i++)
|
||||
{
|
||||
AxisAlignedBB box = (AxisAlignedBB)solids.get(i);
|
||||
if(isCollided(box, yMin, yMax, horizontalTolerance))
|
||||
result = Math.max(result, box.maxY);
|
||||
}
|
||||
return Math.min(result, yMax);
|
||||
}
|
||||
|
||||
protected double getMinPlayerSolidBetween(double yMin, double yMax, double horizontalTolerance)
|
||||
{
|
||||
List<?> solids = getPlayerSolidBetween(yMin, yMax, horizontalTolerance);
|
||||
double result = yMax;
|
||||
for(int i = 0; i < solids.size(); i++)
|
||||
{
|
||||
AxisAlignedBB box = (AxisAlignedBB)solids.get(i);
|
||||
if(isCollided(box, yMin, yMax, horizontalTolerance))
|
||||
result = Math.min(result, box.minY);
|
||||
}
|
||||
return Math.max(result, yMin);
|
||||
}
|
||||
|
||||
protected boolean isInLiquid()
|
||||
{
|
||||
return
|
||||
getMaxPlayerLiquidBetween(sp.boundingBox.minY, sp.boundingBox.maxY) != sp.boundingBox.minY ||
|
||||
getMinPlayerLiquidBetween(sp.boundingBox.minY, sp.boundingBox.maxY) != sp.boundingBox.maxY;
|
||||
}
|
||||
|
||||
protected double getMaxPlayerLiquidBetween(double yMin, double yMax)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int jMin = MathHelper.floor_double(yMin);
|
||||
int jMax = MathHelper.floor_double(yMax);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
|
||||
for(int j = jMax; j >= jMin; j--)
|
||||
{
|
||||
float swimWaterBorder = getLiquidBorder(i, j, k);
|
||||
if(swimWaterBorder > 0)
|
||||
return j + swimWaterBorder;
|
||||
}
|
||||
return yMin;
|
||||
}
|
||||
|
||||
protected double getMinPlayerLiquidBetween(double yMin, double yMax)
|
||||
{
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int jMin = MathHelper.floor_double(yMin);
|
||||
int jMax = MathHelper.floor_double(yMax);
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
|
||||
for(int j = jMin; j <= jMax; j++)
|
||||
{
|
||||
float swimWaterBorder = getLiquidBorder(i, j, k);
|
||||
if(swimWaterBorder > 0)
|
||||
if(j > yMin)
|
||||
return j;
|
||||
else if(j + swimWaterBorder > yMin)
|
||||
return yMin;
|
||||
}
|
||||
return yMax;
|
||||
}
|
||||
|
||||
public boolean isCollided(AxisAlignedBB box, double yMin, double yMax, double horizontalTolerance)
|
||||
{
|
||||
return
|
||||
box.maxX >= sp.boundingBox.minX - horizontalTolerance &&
|
||||
box.minX <= sp.boundingBox.maxX + horizontalTolerance &&
|
||||
box.maxY >= yMin &&
|
||||
box.minY <= yMax &&
|
||||
box.maxZ >= sp.boundingBox.minZ - horizontalTolerance &&
|
||||
box.minZ <= sp.boundingBox.maxZ + horizontalTolerance;
|
||||
}
|
||||
|
||||
private boolean isBlockTranslucent(int i, int j, int k)
|
||||
{
|
||||
return sp.worldObj.isBlockNormalCubeDefault(i, j, k, false);
|
||||
}
|
||||
|
||||
public boolean pushOutOfBlocks(double d, double d1, double d2, boolean top)
|
||||
{
|
||||
int i = MathHelper.floor_double(d);
|
||||
int j = MathHelper.floor_double(d1);
|
||||
int k = MathHelper.floor_double(d2);
|
||||
double d3 = d - i;
|
||||
double d4 = d2 - k;
|
||||
if(isBlockTranslucent(i, j, k) || (top && isBlockTranslucent(i, j + 1, k)))
|
||||
{
|
||||
boolean flag = !isBlockTranslucent(i - 1, j, k) && (!top || !isBlockTranslucent(i - 1, j + 1, k));
|
||||
boolean flag1 = !isBlockTranslucent(i + 1, j, k) && (!top || !isBlockTranslucent(i + 1, j + 1, k));
|
||||
boolean flag2 = !isBlockTranslucent(i, j, k - 1) && (!top || !isBlockTranslucent(i, j + 1, k - 1));
|
||||
boolean flag3 = !isBlockTranslucent(i, j, k + 1) && (!top || !isBlockTranslucent(i, j + 1, k + 1));
|
||||
byte byte0 = -1;
|
||||
double d5 = 9999D;
|
||||
if(flag && d3 < d5)
|
||||
{
|
||||
d5 = d3;
|
||||
byte0 = 0;
|
||||
}
|
||||
if(flag1 && 1.0D - d3 < d5)
|
||||
{
|
||||
d5 = 1.0D - d3;
|
||||
byte0 = 1;
|
||||
}
|
||||
if(flag2 && d4 < d5)
|
||||
{
|
||||
d5 = d4;
|
||||
byte0 = 4;
|
||||
}
|
||||
if(flag3 && 1.0D - d4 < d5)
|
||||
{
|
||||
byte0 = 5;
|
||||
}
|
||||
float f = 0.1F;
|
||||
if(byte0 == 0)
|
||||
{
|
||||
sp.motionX = -f;
|
||||
}
|
||||
if(byte0 == 1)
|
||||
{
|
||||
sp.motionX = f;
|
||||
}
|
||||
if(byte0 == 4)
|
||||
{
|
||||
sp.motionZ = -f;
|
||||
}
|
||||
if(byte0 == 5)
|
||||
{
|
||||
sp.motionZ = f;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isInsideOfMaterial(Material material)
|
||||
{
|
||||
if(SmartMovingOptions.hasFiniteLiquid && material == Material.water)
|
||||
{
|
||||
double d = sp.posY + sp.getEyeHeight();
|
||||
int i = MathHelper.floor_double(sp.posX);
|
||||
int j = MathHelper.floor_float(MathHelper.floor_double(d));
|
||||
int k = MathHelper.floor_double(sp.posZ);
|
||||
Block l = sp.worldObj.getBlock(i, j, k);
|
||||
float border;
|
||||
if(l != null && (border = getFiniteLiquidWaterBorder(i, j, k, l)) > 0)
|
||||
{
|
||||
float f = (1 - border) - 0.1111111F;
|
||||
float f1 = (j + 1) - f;
|
||||
return d < f1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return isp.localIsInsideOfMaterial(material);
|
||||
}
|
||||
|
||||
public int calculateSeparateCollisions(double par1, double par3, double par5)
|
||||
{
|
||||
float ySize = sp.ySize;
|
||||
boolean isInWeb = isp.getIsInWebField();
|
||||
AxisAlignedBB boundingBox = sp.boundingBox.copy();
|
||||
boolean onGround = sp.onGround;
|
||||
World worldObj = sp.worldObj;
|
||||
Entity _this = sp;
|
||||
boolean field_9293_aM = sp.field_70135_K;
|
||||
float stepHeight = sp.stepHeight;
|
||||
|
||||
ySize *= 0.4F;
|
||||
|
||||
if (isInWeb)
|
||||
{
|
||||
isInWeb = false;
|
||||
par1 *= 0.25D;
|
||||
par3 *= 0.05000000074505806D;
|
||||
par5 *= 0.25D;
|
||||
}
|
||||
|
||||
double d2 = par1;
|
||||
double d3 = par3;
|
||||
double d4 = par5;
|
||||
AxisAlignedBB axisalignedbb = boundingBox.copy();
|
||||
boolean flag = onGround && isSneaking();
|
||||
|
||||
if (flag)
|
||||
{
|
||||
double d5 = 0.050000000000000003D;
|
||||
|
||||
for (; par1 != 0.0D && worldObj.getCollidingBoundingBoxes(_this, boundingBox.getOffsetBoundingBox(par1, -1D, 0.0D)).size() == 0; d2 = par1)
|
||||
{
|
||||
if (par1 < d5 && par1 >= -d5)
|
||||
{
|
||||
par1 = 0.0D;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (par1 > 0.0D)
|
||||
{
|
||||
par1 -= d5;
|
||||
}
|
||||
else
|
||||
{
|
||||
par1 += d5;
|
||||
}
|
||||
}
|
||||
|
||||
for (; par5 != 0.0D && worldObj.getCollidingBoundingBoxes(_this, boundingBox.getOffsetBoundingBox(0.0D, -1D, par5)).size() == 0; d4 = par5)
|
||||
{
|
||||
if (par5 < d5 && par5 >= -d5)
|
||||
{
|
||||
par5 = 0.0D;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (par5 > 0.0D)
|
||||
{
|
||||
par5 -= d5;
|
||||
}
|
||||
else
|
||||
{
|
||||
par5 += d5;
|
||||
}
|
||||
}
|
||||
|
||||
while (par1 != 0.0D && par5 != 0.0D && worldObj.getCollidingBoundingBoxes(_this, boundingBox.getOffsetBoundingBox(par1, -1D, par5)).size() == 0)
|
||||
{
|
||||
if (par1 < d5 && par1 >= -d5)
|
||||
{
|
||||
par1 = 0.0D;
|
||||
}
|
||||
else if (par1 > 0.0D)
|
||||
{
|
||||
par1 -= d5;
|
||||
}
|
||||
else
|
||||
{
|
||||
par1 += d5;
|
||||
}
|
||||
|
||||
if (par5 < d5 && par5 >= -d5)
|
||||
{
|
||||
par5 = 0.0D;
|
||||
}
|
||||
else if (par5 > 0.0D)
|
||||
{
|
||||
par5 -= d5;
|
||||
}
|
||||
else
|
||||
{
|
||||
par5 += d5;
|
||||
}
|
||||
|
||||
d2 = par1;
|
||||
d4 = par5;
|
||||
}
|
||||
}
|
||||
|
||||
List<?> list = worldObj.getCollidingBoundingBoxes(_this, boundingBox.addCoord(par1, par3, par5));
|
||||
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
par3 = ((AxisAlignedBB)list.get(i)).calculateYOffset(boundingBox, par3);
|
||||
}
|
||||
|
||||
boundingBox.offset(0.0D, par3, 0.0D);
|
||||
|
||||
if (!field_9293_aM && d3 != par3)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
boolean flag1 = onGround || d3 != par3 && d3 < 0.0D;
|
||||
|
||||
for (int j = 0; j < list.size(); j++)
|
||||
{
|
||||
par1 = ((AxisAlignedBB)list.get(j)).calculateXOffset(boundingBox, par1);
|
||||
}
|
||||
|
||||
boundingBox.offset(par1, 0.0D, 0.0D);
|
||||
|
||||
if (!field_9293_aM && d2 != par1)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
for (int k = 0; k < list.size(); k++)
|
||||
{
|
||||
par5 = ((AxisAlignedBB)list.get(k)).calculateZOffset(boundingBox, par5);
|
||||
}
|
||||
|
||||
boundingBox.offset(0.0D, 0.0D, par5);
|
||||
|
||||
if (!field_9293_aM && d4 != par5)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
if (stepHeight > 0.0F && flag1 && (flag || ySize < 0.05F) && (d2 != par1 || d4 != par5))
|
||||
{
|
||||
double d6 = par1;
|
||||
double d8 = par3;
|
||||
double d10 = par5;
|
||||
par1 = d2;
|
||||
par3 = stepHeight;
|
||||
par5 = d4;
|
||||
AxisAlignedBB axisalignedbb1 = boundingBox.copy();
|
||||
boundingBox.setBB(axisalignedbb);
|
||||
List<?> list1 = worldObj.getCollidingBoundingBoxes(_this, boundingBox.addCoord(par1, par3, par5));
|
||||
|
||||
for (int j2 = 0; j2 < list1.size(); j2++)
|
||||
{
|
||||
par3 = ((AxisAlignedBB)list1.get(j2)).calculateYOffset(boundingBox, par3);
|
||||
}
|
||||
|
||||
boundingBox.offset(0.0D, par3, 0.0D);
|
||||
|
||||
if (!field_9293_aM && d3 != par3)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
for (int k2 = 0; k2 < list1.size(); k2++)
|
||||
{
|
||||
par1 = ((AxisAlignedBB)list1.get(k2)).calculateXOffset(boundingBox, par1);
|
||||
}
|
||||
|
||||
boundingBox.offset(par1, 0.0D, 0.0D);
|
||||
|
||||
if (!field_9293_aM && d2 != par1)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
for (int l2 = 0; l2 < list1.size(); l2++)
|
||||
{
|
||||
par5 = ((AxisAlignedBB)list1.get(l2)).calculateZOffset(boundingBox, par5);
|
||||
}
|
||||
|
||||
boundingBox.offset(0.0D, 0.0D, par5);
|
||||
|
||||
if (!field_9293_aM && d4 != par5)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
|
||||
if (!field_9293_aM && d3 != par3)
|
||||
{
|
||||
par1 = par3 = par5 = 0.0D;
|
||||
}
|
||||
else
|
||||
{
|
||||
par3 = -stepHeight;
|
||||
|
||||
for (int i3 = 0; i3 < list1.size(); i3++)
|
||||
{
|
||||
par3 = ((AxisAlignedBB)list1.get(i3)).calculateYOffset(boundingBox, par3);
|
||||
}
|
||||
|
||||
boundingBox.offset(0.0D, par3, 0.0D);
|
||||
}
|
||||
|
||||
if (d6 * d6 + d10 * d10 >= par1 * par1 + par5 * par5)
|
||||
{
|
||||
par1 = d6;
|
||||
par3 = d8;
|
||||
par5 = d10;
|
||||
boundingBox.setBB(axisalignedbb1);
|
||||
}
|
||||
else
|
||||
{
|
||||
double d11 = boundingBox.minY - (int)boundingBox.minY;
|
||||
|
||||
if (d11 > 0.0D)
|
||||
{
|
||||
ySize += d11 + 0.01D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCollidedPositiveX = d2 > par1;
|
||||
boolean isCollidedNegativeX = d2 < par1;
|
||||
boolean isCollidedPositiveY = d3 > par3;
|
||||
boolean isCollidedNegativeY = d3 < par3;
|
||||
boolean isCollidedPositiveZ = d4 > par5;
|
||||
boolean isCollidedNegativeZ = d4 < par5;
|
||||
|
||||
int result = 0;
|
||||
if(isCollidedPositiveX)
|
||||
result += CollidedPositiveX;
|
||||
if(isCollidedNegativeX)
|
||||
result += CollidedNegativeX;
|
||||
if(isCollidedPositiveY)
|
||||
result += CollidedPositiveY;
|
||||
if(isCollidedNegativeY)
|
||||
result += CollidedNegativeY;
|
||||
if(isCollidedPositiveZ)
|
||||
result += CollidedPositiveZ;
|
||||
if(isCollidedNegativeZ)
|
||||
result += CollidedNegativeZ;
|
||||
return result;
|
||||
}
|
||||
|
||||
public final static int CollidedPositiveX = 1;
|
||||
public final static int CollidedNegativeX = 2;
|
||||
public final static int CollidedPositiveY = 4;
|
||||
public final static int CollidedNegativeY = 8;
|
||||
public final static int CollidedPositiveZ = 16;
|
||||
public final static int CollidedNegativeZ = 32;
|
||||
|
||||
public boolean isSneaking()
|
||||
{
|
||||
return sp.isSneaking();
|
||||
}
|
||||
|
||||
public void correctOnUpdate(boolean isSmall, boolean reverseMaterialAcceleration)
|
||||
{
|
||||
double d = sp.posX - sp.prevPosX;
|
||||
double d1 = sp.posZ - sp.prevPosZ;
|
||||
float f = MathHelper.sqrt_double(d * d + d1 * d1);
|
||||
if(f < 0.05F && f > 0.02 && isSmall)
|
||||
{
|
||||
float f1 = sp.renderYawOffset;
|
||||
|
||||
f1 = ((float)Math.atan2(d1, d) * 180F) / 3.141593F - 90F;
|
||||
|
||||
if(sp.swingProgress > 0.0F)
|
||||
{
|
||||
f1 = sp.rotationYaw;
|
||||
}
|
||||
float f4;
|
||||
for(f4 = f1 - sp.renderYawOffset; f4 < -180F; f4 += 360F) { }
|
||||
for(; f4 >= 180F; f4 -= 360F) { }
|
||||
float x = sp.renderYawOffset + f4 * 0.3F;
|
||||
float f5;
|
||||
for(f5 = sp.rotationYaw - x; f5 < -180F; f5 += 360F) { }
|
||||
for(; f5 >= 180F; f5 -= 360F) { }
|
||||
if(f5 < -75F)
|
||||
{
|
||||
f5 = -75F;
|
||||
}
|
||||
if(f5 >= 75F)
|
||||
{
|
||||
f5 = 75F;
|
||||
}
|
||||
sp.renderYawOffset = sp.rotationYaw - f5;
|
||||
if(f5 * f5 > 2500F)
|
||||
{
|
||||
sp.renderYawOffset += f5 * 0.2F;
|
||||
}
|
||||
for(; sp.renderYawOffset - sp.prevRenderYawOffset < -180F; sp.prevRenderYawOffset -= 360F) { }
|
||||
for(; sp.renderYawOffset - sp.prevRenderYawOffset >= 180F; sp.prevRenderYawOffset += 360F) { }
|
||||
}
|
||||
|
||||
if(reverseMaterialAcceleration)
|
||||
reverseHandleMaterialAcceleration();
|
||||
}
|
||||
|
||||
protected double getGapUnderneight()
|
||||
{
|
||||
return sp.boundingBox.minY - getMaxPlayerSolidBetween(sp.boundingBox.minY - 1.1D, sp.boundingBox.minY, 0);
|
||||
}
|
||||
|
||||
protected double getGapOverneight()
|
||||
{
|
||||
return getMinPlayerSolidBetween(sp.boundingBox.maxY, sp.boundingBox.maxY + 1.1D, 0) - sp.boundingBox.maxY;
|
||||
}
|
||||
|
||||
public double getOverGroundHeight(double maximum)
|
||||
{
|
||||
if(esp != null)
|
||||
return (sp.boundingBox.minY - getMaxPlayerSolidBetween(sp.boundingBox.minY - maximum, sp.boundingBox.minY, 0));
|
||||
return (sp.boundingBox.minY + 1D - getMaxPlayerSolidBetween(sp.boundingBox.minY - maximum + 1D, sp.boundingBox.minY + 1D, 0.1));
|
||||
}
|
||||
|
||||
public Block getOverGroundBlockId(double distance)
|
||||
{
|
||||
int x = MathHelper.floor_double(sp.posX);
|
||||
int y = MathHelper.floor_double(sp.boundingBox.minY);
|
||||
int z = MathHelper.floor_double(sp.posZ);
|
||||
int minY = y - (int)Math.ceil(distance);
|
||||
|
||||
if(esp == null)
|
||||
{
|
||||
y++;
|
||||
minY++;
|
||||
}
|
||||
|
||||
for(; y >= minY; y--)
|
||||
{
|
||||
Block block = sp.worldObj.getBlock(x, y, z);
|
||||
if(block != null)
|
||||
return block;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void reverseHandleMaterialAcceleration()
|
||||
{
|
||||
AxisAlignedBB axisalignedbb = sp.boundingBox.expand(0.0D, -0.40000000596046448D, 0.0D).contract(0.001D, 0.001D, 0.001D);
|
||||
Material material = Material.water;
|
||||
Entity entity = sp;
|
||||
|
||||
int i = MathHelper.floor_double(axisalignedbb.minX);
|
||||
int j = MathHelper.floor_double(axisalignedbb.maxX + 1.0D);
|
||||
int k = MathHelper.floor_double(axisalignedbb.minY);
|
||||
int l = MathHelper.floor_double(axisalignedbb.maxY + 1.0D);
|
||||
int i1 = MathHelper.floor_double(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.floor_double(axisalignedbb.maxZ + 1.0D);
|
||||
if(!entity.worldObj.checkChunksExist(i, k, i1, j, l, j1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vec3 vec3d = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D);
|
||||
for(int k1 = i; k1 < j; k1++)
|
||||
{
|
||||
for(int l1 = k; l1 < l; l1++)
|
||||
{
|
||||
for(int i2 = i1; i2 < j1; i2++)
|
||||
{
|
||||
Block block = entity.worldObj.getBlock(k1, l1, i2);
|
||||
if(block == null || block.getMaterial() != material)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
double d1 = (l1 + 1) - BlockLiquid.getLiquidHeightPercent(entity.worldObj.getBlockMetadata(k1, l1, i2));
|
||||
if(l >= d1)
|
||||
{
|
||||
block.velocityToAddToEntity(entity.worldObj, k1, l1, i2, entity, vec3d);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(vec3d.lengthVector() > 0.0D)
|
||||
{
|
||||
vec3d = vec3d.normalize();
|
||||
double d = -0.014D; // instead +0.014D for reversal
|
||||
entity.motionX += vec3d.xCoord * d;
|
||||
entity.motionY += vec3d.yCoord * d;
|
||||
entity.motionZ += vec3d.zCoord * d;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SmartMovingClient extends SmartMovingContext implements ISmartMovingClient
|
||||
{
|
||||
private final Map<String, Float> maximumExhaustionValues = new HashMap<String, Float>();
|
||||
private boolean nativeUserInterfaceDrawing = true;
|
||||
|
||||
@Override
|
||||
public float getMaximumExhaustion()
|
||||
{
|
||||
float maxExhaustion = Config.getMaxExhaustion();
|
||||
if(maximumExhaustionValues.size() > 0)
|
||||
{
|
||||
Iterator<Float> iterator = maximumExhaustionValues.values().iterator();
|
||||
while(iterator.hasNext())
|
||||
maxExhaustion = Math.max(iterator.next(), maxExhaustion);
|
||||
}
|
||||
return maxExhaustion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaximumUpJumpCharge()
|
||||
{
|
||||
return Config._jumpChargeMaximum.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaximumHeadJumpCharge()
|
||||
{
|
||||
return Config._headJumpChargeMaximum.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaximumExhaustionValue(String key, float value)
|
||||
{
|
||||
maximumExhaustionValues.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaximumExhaustionValue(String key)
|
||||
{
|
||||
return maximumExhaustionValues.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeMaximumExhaustionValue(String key)
|
||||
{
|
||||
return maximumExhaustionValues.remove(key) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNativeUserInterfaceDrawing(boolean value)
|
||||
{
|
||||
nativeUserInterfaceDrawing = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getNativeUserInterfaceDrawing()
|
||||
{
|
||||
return nativeUserInterfaceDrawing;
|
||||
}
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.network.play.client.*;
|
||||
import net.minecraft.server.*;
|
||||
import net.smart.moving.config.*;
|
||||
import net.smart.properties.*;
|
||||
|
||||
public class SmartMovingComm extends SmartMovingContext implements IPacketReceiver, IPacketSender
|
||||
{
|
||||
@Override
|
||||
public boolean processStatePacket(FMLProxyPacket packet, IEntityPlayerMP player, int entityId, long state)
|
||||
{
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(entityId);
|
||||
if(entity == null)
|
||||
return true;
|
||||
|
||||
SmartMovingOther moving = SmartMovingFactory.getOtherSmartMoving((EntityOtherPlayerMP)entity);
|
||||
if(moving != null)
|
||||
moving.processStatePacket(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigInfoPacket(FMLProxyPacket packet, IEntityPlayerMP player, String info)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigContentPacket(FMLProxyPacket packet, IEntityPlayerMP player, String[] content, String username)
|
||||
{
|
||||
processConfigPacket(content, username, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigChangePacket(FMLProxyPacket packet, IEntityPlayerMP player)
|
||||
{
|
||||
SmartMovingOptions.writeNoRightsToChangeConfigMessageToChat(isConnectedToRemoteServer());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processSpeedChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, int difference, String username)
|
||||
{
|
||||
if(difference == 0)
|
||||
SmartMovingOptions.writeNoRightsToChangeSpeedMessageToChat(isConnectedToRemoteServer());
|
||||
else
|
||||
{
|
||||
Config.changeSpeed(difference);
|
||||
Options.writeServerSpeedMessageToChat(username, Config._globalConfig.value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processHungerChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, float hunger)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processSoundPacket(FMLProxyPacket packet, IEntityPlayerMP player, String soundId, float distance, float pitch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isConnectedToRemoteServer()
|
||||
{
|
||||
return MinecraftServer.getServer() == null || Minecraft.getMinecraft().getIntegratedServer() == null || !Minecraft.getMinecraft().getIntegratedServer().isSinglePlayer();
|
||||
}
|
||||
|
||||
public static void processConfigPacket(String[] content, String username, boolean blockCode)
|
||||
{
|
||||
boolean isGloballyConfigured = false;
|
||||
if(content != null && content.length == 2 && Options._globalConfig.getCurrentKey().equals(content[0]))
|
||||
{
|
||||
isGloballyConfigured = "true".equals(content[1]);
|
||||
content = null;
|
||||
}
|
||||
|
||||
boolean wasEnabled = Config.enabled;
|
||||
boolean first = Config != ServerConfig;
|
||||
if(first)
|
||||
ServerConfig.reset();
|
||||
|
||||
if(content != null)
|
||||
if(content.length != 0)
|
||||
{
|
||||
ServerConfig.loadFromProperties(content, blockCode);
|
||||
isGloballyConfigured = ServerConfig._globalConfig.value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Config = Options;
|
||||
Options.writeServerDeconfigMessageToChat();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerConfig.load(false);
|
||||
ServerConfig.setCurrentKey(null);
|
||||
}
|
||||
|
||||
ServerConfig._globalConfig.value = isGloballyConfigured;
|
||||
|
||||
if(!first)
|
||||
{
|
||||
Options.writeServerReconfigMessageToChat(wasEnabled, username, isGloballyConfigured);
|
||||
return;
|
||||
}
|
||||
|
||||
Config = ServerConfig;
|
||||
Options.writeServerConfigMessageToChat();
|
||||
if (!blockCode)
|
||||
SmartMovingPacketStream.sendConfigInfo(SmartMovingComm.instance, SmartMovingConfig._sm_current);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(byte[] data)
|
||||
{
|
||||
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C17PacketCustomPayload(SmartMovingPacketStream.Id, data));
|
||||
}
|
||||
|
||||
public static boolean processBlockCode(String text)
|
||||
{
|
||||
if(!text.startsWith("§0§1") || !text.endsWith("§f§f"))
|
||||
return false;
|
||||
|
||||
String codes = text.substring(4, text.length() - 4);
|
||||
processBlockCode(codes, "§0", Options._baseClimb, "standard");
|
||||
processBlockCode(codes, "§1", Options._freeClimb);
|
||||
processBlockCode(codes, "§2", Options._ceilingClimbing);
|
||||
processBlockCode(codes, "§3", Options._swim);
|
||||
processBlockCode(codes, "§4", Options._dive);
|
||||
processBlockCode(codes, "§5", Options._crawl);
|
||||
processBlockCode(codes, "§6", Options._slide);
|
||||
processBlockCode(codes, "§7", Options._fly);
|
||||
processBlockCode(codes, "§8", Options._jumpCharge);
|
||||
processBlockCode(codes, "§9", Options._headJump);
|
||||
processBlockCode(codes, "§a", Options._angleJumpSide);
|
||||
processBlockCode(codes, "§b", Options._angleJumpBack);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void processBlockCode(String text, String blockCode, Property<?> property, String... value)
|
||||
{
|
||||
if(text.contains(blockCode))
|
||||
processConfigPacket(new String[] { property.getCurrentKey(), value.length > 0 ? value[0] : "false" }, null, true);
|
||||
}
|
||||
|
||||
public static final SmartMovingComm instance = new SmartMovingComm();
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import cpw.mods.fml.client.registry.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.server.*;
|
||||
|
||||
import net.smart.moving.config.*;
|
||||
import net.smart.render.*;
|
||||
|
||||
public abstract class SmartMovingContext extends SmartRenderContext
|
||||
{
|
||||
public static final float ClimbPullMotion = 0.3F;
|
||||
|
||||
public static final double FastUpMotion = 0.2D;
|
||||
public static final double MediumUpMotion = 0.14D;
|
||||
public static final double SlowUpMotion = 0.1D;
|
||||
public static final double HoldMotion = 0.08D;
|
||||
public static final double SinkDownMotion = 0.05D;
|
||||
public static final double ClimbDownMotion = 0.01D;
|
||||
public static final double CatchCrawlGapMotion = 0.17D;
|
||||
|
||||
public static final float SwimCrawlWaterMaxBorder = 1F;
|
||||
public static final float SwimCrawlWaterTopBorder = 0.65F;
|
||||
public static final float SwimCrawlWaterMediumBorder = 0.6F;
|
||||
public static final float SwimCrawlWaterBottomBorder = 0.55F;
|
||||
|
||||
public static final float HorizontalGroundDamping = 0.546F;
|
||||
public static final float HorizontalAirDamping = 0.91F;
|
||||
public static final float HorizontalAirodynamicDamping = 0.999F;
|
||||
|
||||
public static final float SwimSoundDistance = 1F / 0.7F;
|
||||
public static final float SlideToHeadJumpingFallDistance = 0.05F;
|
||||
|
||||
|
||||
public static final SmartMovingClient Client = new SmartMovingClient();
|
||||
public static final SmartMovingOptions Options = new SmartMovingOptions();
|
||||
public static final SmartMovingServerConfig ServerConfig = new SmartMovingServerConfig();
|
||||
public static SmartMovingClientConfig Config = Options;
|
||||
|
||||
|
||||
private static boolean wasInitialized;
|
||||
|
||||
public static void onTickInGame()
|
||||
{
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
|
||||
if(minecraft.theWorld != null && minecraft.theWorld.isRemote)
|
||||
SmartMovingFactory.handleMultiPlayerTick(minecraft);
|
||||
|
||||
Options.initializeForGameIfNeccessary();
|
||||
|
||||
initializeServerIfNecessary();
|
||||
}
|
||||
|
||||
public static void initialize()
|
||||
{
|
||||
if(!wasInitialized)
|
||||
net.smart.render.statistics.SmartStatisticsContext.setCalculateHorizontalStats(true);
|
||||
|
||||
ClientRegistry.registerKeyBinding(Options.keyBindGrab);
|
||||
ClientRegistry.registerKeyBinding(Options.keyBindConfigToggle);
|
||||
ClientRegistry.registerKeyBinding(Options.keyBindSpeedIncrease);
|
||||
ClientRegistry.registerKeyBinding(Options.keyBindSpeedDecrease);
|
||||
|
||||
if(wasInitialized)
|
||||
return;
|
||||
|
||||
wasInitialized = true;
|
||||
|
||||
System.out.println(SmartMovingInfo.ModComMessage);
|
||||
FMLLog.getLogger().info(SmartMovingInfo.ModComMessage);
|
||||
}
|
||||
|
||||
public static void initializeServerIfNecessary()
|
||||
{
|
||||
MinecraftServer currentMinecraftServer = MinecraftServer.getServer();
|
||||
if(currentMinecraftServer != null && currentMinecraftServer != lastMinecraftServer)
|
||||
SmartMovingServer.initialize(SmartMovingOptions.optionsPath, currentMinecraftServer.getGameType().getID(), Options);
|
||||
lastMinecraftServer = currentMinecraftServer;
|
||||
}
|
||||
|
||||
public static void registerRenderers()
|
||||
{
|
||||
registerRenderers(net.smart.moving.render.RenderPlayer.class);
|
||||
}
|
||||
|
||||
private static MinecraftServer lastMinecraftServer = null;
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.client.multiplayer.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.client.*;
|
||||
import net.minecraft.server.management.*;
|
||||
|
||||
import net.smart.core.*;
|
||||
import net.smart.moving.playerapi.*;
|
||||
|
||||
public class SmartMovingCoreEventHandler extends SmartCoreEventHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void beforeProcessPlayer(NetHandlerPlayServer netServerHandler)
|
||||
{
|
||||
SmartMovingServerPlayerBase playerBase = SmartMovingServerPlayerBase.getPlayerBase(netServerHandler.playerEntity);
|
||||
playerBase.moving.beforeAddMovingHungerBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterProcessPlayer(NetHandlerPlayServer netServerHandler)
|
||||
{
|
||||
SmartMovingServerPlayerBase playerBase = SmartMovingServerPlayerBase.getPlayerBase(netServerHandler.playerEntity);
|
||||
playerBase.moving.afterAddMovingHungerBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
if (packet15place.func_149568_f() == 255)
|
||||
{
|
||||
ItemStack itemstack = netServerHandler.playerEntity.inventory.getCurrentItem();
|
||||
if (itemstack != null)
|
||||
{
|
||||
float offset = 1.62F - netServerHandler.playerEntity.getEyeHeight();
|
||||
netServerHandler.playerEntity.yOffset += offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterProcessPlayerBlockPlacement(NetHandlerPlayServer netServerHandler, C08PacketPlayerBlockPlacement packet15place)
|
||||
{
|
||||
if (packet15place.func_149568_f() == 255)
|
||||
{
|
||||
ItemStack itemstack = netServerHandler.playerEntity.inventory.getCurrentItem();
|
||||
if (itemstack != null)
|
||||
{
|
||||
float offset = 1.62F - netServerHandler.playerEntity.getEyeHeight();
|
||||
netServerHandler.playerEntity.yOffset -= offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP)
|
||||
{
|
||||
SmartMovingPlayerBase playerBase = SmartMovingPlayerBase.getPlayerBase((EntityPlayerSP)entityPlayerSP);
|
||||
playerBase.moving.beforeActivateBlockOrUseItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterOnPlayerRightClick(PlayerControllerMP playerControllerMP, EntityPlayer entityPlayerSP)
|
||||
{
|
||||
SmartMovingPlayerBase playerBase = SmartMovingPlayerBase.getPlayerBase((EntityPlayerSP)entityPlayerSP);
|
||||
playerBase.moving.afterActivateBlockOrUseItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer)
|
||||
{
|
||||
SmartMovingServerPlayerBase playerBase = SmartMovingServerPlayerBase.getPlayerBase(entityPlayer);
|
||||
playerBase.moving.beforeActivateBlockOrUseItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterActivateBlockOrUseItem(ItemInWorldManager itemInWorldManager, EntityPlayer entityPlayer)
|
||||
{
|
||||
SmartMovingServerPlayerBase playerBase = SmartMovingServerPlayerBase.getPlayerBase(entityPlayer);
|
||||
playerBase.moving.afterActivateBlockOrUseItem();
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
|
||||
public class SmartMovingFactory extends SmartMovingContext
|
||||
{
|
||||
private static SmartMovingFactory factory;
|
||||
|
||||
private Hashtable<Integer, SmartMovingOther> otherSmartMovings;
|
||||
|
||||
public SmartMovingFactory()
|
||||
{
|
||||
if(factory != null)
|
||||
throw new RuntimeException("FATAL: Can only create one instance of type 'SmartMovingFactory'");
|
||||
factory = this;
|
||||
}
|
||||
|
||||
protected static boolean isInitialized()
|
||||
{
|
||||
return factory != null;
|
||||
}
|
||||
|
||||
public static void initialize()
|
||||
{
|
||||
if(!isInitialized())
|
||||
new SmartMovingFactory();
|
||||
}
|
||||
|
||||
public static void handleMultiPlayerTick(Minecraft minecraft)
|
||||
{
|
||||
factory.doHandleMultiPlayerTick(minecraft);
|
||||
}
|
||||
|
||||
public static SmartMoving getInstance(EntityPlayer entityPlayer)
|
||||
{
|
||||
return factory.doGetInstance(entityPlayer);
|
||||
}
|
||||
|
||||
public static SmartMoving getOtherSmartMoving(int entityId)
|
||||
{
|
||||
return factory.doGetOtherSmartMoving(entityId);
|
||||
}
|
||||
|
||||
public static SmartMovingOther getOtherSmartMoving(EntityOtherPlayerMP entity)
|
||||
{
|
||||
return factory.doGetOtherSmartMoving(entity);
|
||||
}
|
||||
|
||||
protected void doHandleMultiPlayerTick(Minecraft minecraft)
|
||||
{
|
||||
Iterator<?> others = minecraft.theWorld.playerEntities.iterator();
|
||||
while(others.hasNext())
|
||||
{
|
||||
Entity player = (Entity)others.next();
|
||||
if(player instanceof EntityOtherPlayerMP)
|
||||
{
|
||||
EntityOtherPlayerMP otherPlayer = (EntityOtherPlayerMP)player;
|
||||
SmartMovingOther moving = doGetOtherSmartMoving(otherPlayer);
|
||||
moving.spawnParticles(minecraft, otherPlayer.posX - otherPlayer.prevPosX, otherPlayer.posZ - otherPlayer.prevPosZ);
|
||||
moving.foundAlive = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(otherSmartMovings == null || otherSmartMovings.isEmpty())
|
||||
return;
|
||||
|
||||
Iterator<Integer> entityIds = otherSmartMovings.keySet().iterator();
|
||||
while(entityIds.hasNext())
|
||||
{
|
||||
Integer entityId = entityIds.next();
|
||||
SmartMovingOther moving = otherSmartMovings.get(entityId);
|
||||
if(moving.foundAlive)
|
||||
moving.foundAlive = false;
|
||||
else
|
||||
entityIds.remove();
|
||||
}
|
||||
}
|
||||
|
||||
protected SmartMoving doGetInstance(EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entityPlayer instanceof EntityOtherPlayerMP)
|
||||
return doGetOtherSmartMoving(entityPlayer.getEntityId());
|
||||
else if(entityPlayer instanceof IEntityPlayerSP)
|
||||
return ((IEntityPlayerSP)entityPlayer).getMoving();
|
||||
return null;
|
||||
}
|
||||
|
||||
protected SmartMoving doGetOtherSmartMoving(int entityId)
|
||||
{
|
||||
SmartMoving moving = tryGetOtherSmartMoving(entityId);
|
||||
if(moving == null)
|
||||
{
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(entityId);
|
||||
if(entity != null && entity instanceof EntityOtherPlayerMP)
|
||||
moving = addOtherSmartMoving((EntityOtherPlayerMP)entity);
|
||||
}
|
||||
return moving;
|
||||
}
|
||||
|
||||
protected SmartMovingOther doGetOtherSmartMoving(EntityOtherPlayerMP entity)
|
||||
{
|
||||
SmartMovingOther moving = tryGetOtherSmartMoving(entity.getEntityId());
|
||||
if(moving == null)
|
||||
moving = addOtherSmartMoving(entity);
|
||||
return moving;
|
||||
}
|
||||
|
||||
protected final SmartMovingOther tryGetOtherSmartMoving(int entityId)
|
||||
{
|
||||
if(otherSmartMovings == null)
|
||||
otherSmartMovings = new Hashtable<Integer, SmartMovingOther>();
|
||||
return otherSmartMovings.get(entityId);
|
||||
}
|
||||
|
||||
protected final SmartMovingOther addOtherSmartMoving(EntityOtherPlayerMP entity)
|
||||
{
|
||||
SmartMovingOther moving = new SmartMovingOther(entity);
|
||||
otherSmartMovings.put(entity.getEntityId(), moving);
|
||||
return moving;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
public class SmartMovingInfo
|
||||
{
|
||||
public static final byte StatePacketId = 0;
|
||||
public static final byte ConfigInfoPacketId = 1;
|
||||
public static final byte ConfigContentPacketId = 2;
|
||||
public static final byte ConfigChangePacketId = 3;
|
||||
public static final byte SpeedChangePacketId = 4;
|
||||
public static final byte HungerChangePacketId = 5;
|
||||
public static final byte SoundPacketId = 6;
|
||||
|
||||
private static final Mod Mod = SmartMovingMod.class.getAnnotation(Mod.class);
|
||||
|
||||
public static final String ModId = Mod.modid();
|
||||
public static final String ModName = Mod.name();
|
||||
public static final String ModVersion = Mod.version();
|
||||
public static final String ModComVersion = SmartMovingMod.ModComVersion;
|
||||
|
||||
public static final String ModComMessage = ModName + " uses communication protocol " + ModComVersion;
|
||||
public static final String ModComId = ModName.replace(" ", "") + " " + ModComVersion;
|
||||
|
||||
public static final int DefaultChatId = 0;
|
||||
public static final int ConfigChatId = ModName.hashCode();
|
||||
public static final int SpeedChatId = ModName.hashCode() + 1;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.smart.utilities.*;
|
||||
|
||||
public class SmartMovingInstall
|
||||
{
|
||||
public final static Name RopesPlusCore = new Name("atomicstryker.ropesplus.common.RopesPlusCore");
|
||||
public final static Name ModBlockFence = new Name("net.minecraft.src.modBlockFence", "modBlockFence");
|
||||
public final static Name MacroModCore = new Name("net.eq2online.macros.core.MacroModCore");
|
||||
public final static Name BlockSturdyLadder = new Name("mods.chupmacabre.ladderKit.sturdyLadders.BlockSturdyLadder");
|
||||
public final static Name BlockRopeLadder = new Name("mods.chupmacabre.ladderKit.ropeLadders.BlockRopeLadder");
|
||||
|
||||
public final static Name RopesPlusClient = new Name("atomicstryker.ropesplus.client.RopesPlusClient");
|
||||
public final static Name RopesPlusClient_onZipLine = new Name("onZipLine");
|
||||
|
||||
public final static Name CarpentersBlockLadder = new Name("com.carpentersblocks.block.BlockCarpentersLadder");
|
||||
public final static Name CarpentersTEBaseBlock = new Name("com.carpentersblocks.tileentity.TEBase");
|
||||
public final static Name CarpentersTEBaseBlock_getData = new Name("getData");
|
||||
|
||||
public final static Name NetServerHandler_ticksForFloatKick = new Name("floatingTickCount", "field_147365_f", "f");
|
||||
public final static Name GuiNewChat_chatMessageList = new Name("chatLines", "field_146252_h", "h");
|
||||
public final static Name PlayerControllerMP_currentGameType = new Name("currentGameType", "field_78779_k", "k");
|
||||
public final static Name ModifiableAttributeInstance_attributeValue = new Name("cachedValue", "field_111139_h", "h");
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.Mod.*;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.eventhandler.*;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.*;
|
||||
import cpw.mods.fml.common.network.*;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.network.*;
|
||||
import net.smart.core.*;
|
||||
import net.smart.moving.config.*;
|
||||
import net.smart.utilities.*;
|
||||
|
||||
@Mod(modid = "SmartMoving", name = "Smart Moving", version = "15.6", dependencies = "required-after:PlayerAPI@[1.3,)")
|
||||
public class SmartMovingMod
|
||||
{
|
||||
protected static String ModComVersion = "2.3.1";
|
||||
|
||||
private final boolean isClient;
|
||||
|
||||
private boolean hasRenderer = false;
|
||||
|
||||
public SmartMovingMod()
|
||||
{
|
||||
isClient = FMLCommonHandler.instance().getSide().isClient();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@SuppressWarnings("unused")
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
NetworkRegistry.INSTANCE.newEventDrivenChannel(SmartMovingPacketStream.Id).register(this);
|
||||
|
||||
if(isClient)
|
||||
{
|
||||
hasRenderer = Loader.isModLoaded("RenderPlayerAPI");
|
||||
|
||||
net.smart.moving.playerapi.SmartMoving.register();
|
||||
|
||||
if(hasRenderer)
|
||||
{
|
||||
Class<?> type = Reflect.LoadClass(SmartMovingMod.class, new Name("net.smart.moving.render.playerapi.SmartMoving"), true);
|
||||
Method method = Reflect.GetMethod(type, new Name("register"));
|
||||
Reflect.Invoke(method, null);
|
||||
}
|
||||
else
|
||||
net.smart.render.SmartRenderMod.doNotAddRenderer();
|
||||
|
||||
SmartMovingServerComm.localUserNameProvider = new LocalUserNameProvider();
|
||||
if(!hasRenderer)
|
||||
SmartMovingContext.registerRenderers();
|
||||
|
||||
registerGameTicks();
|
||||
|
||||
net.smart.moving.playerapi.SmartMovingFactory.initialize();
|
||||
|
||||
checkForPresentModsAndInitializeOptions();
|
||||
|
||||
SmartMovingContext.initialize();
|
||||
}
|
||||
else
|
||||
SmartMovingServer.initialize(new File("."), FMLCommonHandler.instance().getMinecraftServerInstance().getGameType().getID(), new SmartMovingConfig());
|
||||
|
||||
SmartCoreEventHandler.Add(new SmartMovingCoreEventHandler());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@SuppressWarnings("unused")
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
if(!isClient)
|
||||
net.smart.moving.playerapi.SmartMovingServerPlayerBase.registerPlayerBase();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SuppressWarnings({ "static-method", "unused" })
|
||||
public void tickStart(ClientTickEvent event)
|
||||
{
|
||||
SmartMovingContext.onTickInGame();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SuppressWarnings("static-method")
|
||||
public void onPacketData(ServerCustomPacketEvent event)
|
||||
{
|
||||
SmartMovingPacketStream.receivePacket(event.packet, SmartMovingServerComm.instance, net.smart.moving.playerapi.SmartMovingServerPlayerBase.getPlayerBase(((NetHandlerPlayServer)event.handler).playerEntity));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SuppressWarnings("static-method")
|
||||
public void onPacketData(ClientCustomPacketEvent event)
|
||||
{
|
||||
SmartMovingPacketStream.receivePacket(event.packet, SmartMovingComm.instance, null);
|
||||
}
|
||||
|
||||
public void registerGameTicks()
|
||||
{
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public Object getInstance(EntityPlayer entityPlayer)
|
||||
{
|
||||
return SmartMovingFactory.getInstance(entityPlayer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public Object getClient()
|
||||
{
|
||||
return SmartMovingContext.Client;
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
public void checkForPresentModsAndInitializeOptions()
|
||||
{
|
||||
List<ModContainer> modList = Loader.instance().getActiveModList();
|
||||
boolean hasRedPowerWiring = false;
|
||||
boolean hasBuildCraftTransport = false;
|
||||
boolean hasFiniteLiquid = false;
|
||||
boolean hasBetterThanWolves = false;
|
||||
boolean hasSinglePlayerCommands = false;
|
||||
boolean hasRopesPlus = false;
|
||||
boolean hasASGrapplingHook = false;
|
||||
boolean hasBetterMisc = false;
|
||||
|
||||
for(int i = 0; i < modList.size(); i++)
|
||||
{
|
||||
ModContainer mod = modList.get(i);
|
||||
String name = mod.getName();
|
||||
|
||||
if(name.contains("RedPowerWiring"))
|
||||
hasRedPowerWiring = true;
|
||||
else if(name.contains("BuildCraftTransport"))
|
||||
hasBuildCraftTransport = true;
|
||||
else if(name.contains("Liquid"))
|
||||
hasFiniteLiquid = true;
|
||||
else if(name.contains("FCBetterThanWolves"))
|
||||
hasBetterThanWolves = true;
|
||||
else if(name.contains("SinglePlayerCommands"))
|
||||
hasSinglePlayerCommands = true;
|
||||
else if(name.contains("ASGrapplingHook"))
|
||||
hasASGrapplingHook = true;
|
||||
else if(name.contains("BetterMisc"))
|
||||
hasBetterMisc = true;
|
||||
}
|
||||
|
||||
hasRopesPlus = Reflect.CheckClasses(SmartMovingMod.class, SmartMovingInstall.RopesPlusCore);
|
||||
|
||||
SmartMovingOptions.initialize(hasRedPowerWiring, hasBuildCraftTransport, hasFiniteLiquid, hasBetterThanWolves, hasSinglePlayerCommands, hasRopesPlus, hasASGrapplingHook, hasBetterMisc);
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
|
||||
public class SmartMovingOther extends SmartMoving
|
||||
{
|
||||
public boolean foundAlive;
|
||||
|
||||
public SmartMovingOther(EntityOtherPlayerMP sp)
|
||||
{
|
||||
super(sp, null);
|
||||
}
|
||||
|
||||
public void processStatePacket(long state)
|
||||
{
|
||||
actualFeetClimbType = (int)(state & 15);
|
||||
state >>>= 4;
|
||||
|
||||
actualHandsClimbType = (int)(state & 15);
|
||||
state >>>= 4;
|
||||
|
||||
_isJumping = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isDiving = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isDipping = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isSwimming = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isCrawlClimbing = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isCrawling = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isClimbing = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
boolean isSmall = (state & 1) != 0;
|
||||
heightOffset = isSmall ? -1 : 0;
|
||||
sp.height = 1.8F + heightOffset;
|
||||
state >>>= 1;
|
||||
|
||||
_doFallingAnimation = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
_doFlyingAnimation = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isCeilingClimbing = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isLevitating = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isHeadJumping = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isSliding = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
angleJumpType = (int)(state & 7);
|
||||
state >>>= 3;
|
||||
|
||||
isFeetVineClimbing = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isHandsVineClimbing = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isClimbJumping = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
boolean wasClimbBackJumping = isClimbBackJumping;
|
||||
isClimbBackJumping = (state & 1) != 0;
|
||||
if(!wasClimbBackJumping && isClimbBackJumping)
|
||||
onStartClimbBackJump();
|
||||
state >>>= 1;
|
||||
|
||||
isSlow = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
isFast = (state & 1) != 0;
|
||||
state >>>= 1;
|
||||
|
||||
boolean wasWallJumping = isWallJumping;
|
||||
isWallJumping = (state & 1) != 0;
|
||||
if(!wasWallJumping && isWallJumping)
|
||||
onStartWallJump(null);
|
||||
state >>>= 1;
|
||||
|
||||
isRopeSliding = (state & 1) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJumping()
|
||||
{
|
||||
return _isJumping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doFlyingAnimation()
|
||||
{
|
||||
return _doFlyingAnimation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doFallingAnimation()
|
||||
{
|
||||
return _doFallingAnimation;
|
||||
}
|
||||
|
||||
private boolean _isJumping = false;
|
||||
private boolean _doFlyingAnimation = false;
|
||||
private boolean _doFallingAnimation = false;
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
|
||||
public class SmartMovingPacketStream
|
||||
{
|
||||
public static final String Id;
|
||||
public static final Set<StackTraceElement> errors;
|
||||
|
||||
static
|
||||
{
|
||||
String id = SmartMovingInfo.ModComId;
|
||||
if(id.length() > 15)
|
||||
id = id.substring(0, 15);
|
||||
Id = id;
|
||||
errors = new HashSet<StackTraceElement>();
|
||||
}
|
||||
|
||||
public static void receivePacket(FMLProxyPacket packet, IPacketReceiver comm, IEntityPlayerMP player)
|
||||
{
|
||||
try
|
||||
{
|
||||
ByteArrayInputStream byteInput = new ByteArrayInputStream(packet.payload().array());
|
||||
ObjectInputStream objectInput = new ObjectInputStream(byteInput);
|
||||
byte packetId = objectInput.readByte();
|
||||
switch(packetId)
|
||||
{
|
||||
case SmartMovingInfo.StatePacketId:
|
||||
int entityId = objectInput.readInt();
|
||||
long state = objectInput.readLong();
|
||||
comm.processStatePacket(packet, player, entityId, state);
|
||||
break;
|
||||
case SmartMovingInfo.ConfigInfoPacketId:
|
||||
String info = (String)objectInput.readObject();
|
||||
comm.processConfigInfoPacket(packet, player, info);
|
||||
break;
|
||||
case SmartMovingInfo.ConfigContentPacketId:
|
||||
String[] content = (String[])objectInput.readObject();
|
||||
String username = (String)objectInput.readObject();
|
||||
comm.processConfigContentPacket(packet, player, content, username);
|
||||
break;
|
||||
case SmartMovingInfo.ConfigChangePacketId:
|
||||
comm.processConfigChangePacket(packet, player);
|
||||
break;
|
||||
case SmartMovingInfo.SpeedChangePacketId:
|
||||
int difference = objectInput.readInt();
|
||||
username = (String)objectInput.readObject();
|
||||
comm.processSpeedChangePacket(packet, player, difference, username);
|
||||
break;
|
||||
case SmartMovingInfo.HungerChangePacketId:
|
||||
float hunger = objectInput.readFloat();
|
||||
comm.processHungerChangePacket(packet, player, hunger);
|
||||
break;
|
||||
case SmartMovingInfo.SoundPacketId:
|
||||
String soundId = (String)objectInput.readObject();
|
||||
float volume = objectInput.readFloat();
|
||||
float pitch = objectInput.readFloat();
|
||||
comm.processSoundPacket(packet, player, soundId, volume, pitch);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Unknown packet id '" + packetId + "' found");
|
||||
}
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
if(errors.add(t.getStackTrace()[0]))
|
||||
t.printStackTrace();
|
||||
else
|
||||
System.err.println(t.getClass().getName() + ": " + t.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendState(IPacketSender comm, int entityId, long state)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.StatePacketId);
|
||||
objectOutput.writeInt(entityId);
|
||||
objectOutput.writeLong(state);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendConfigInfo(IPacketSender comm, String info)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.ConfigInfoPacketId);
|
||||
objectOutput.writeObject(info);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendConfigContent(IPacketSender comm, String[] content, String username)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.ConfigContentPacketId);
|
||||
objectOutput.writeObject(content);
|
||||
objectOutput.writeObject(username);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendConfigChange(IPacketSender comm)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.ConfigChangePacketId);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendSpeedChange(IPacketSender comm, int difference, String username)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.SpeedChangePacketId);
|
||||
objectOutput.writeInt(difference);
|
||||
objectOutput.writeObject(username);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendHungerChange(IPacketSender comm, float hunger)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.HungerChangePacketId);
|
||||
objectOutput.writeFloat(hunger);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
|
||||
public static void sendSound(IPacketSender comm, String soundId, float volume, float pitch)
|
||||
{
|
||||
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ObjectOutputStream objectOutput = new ObjectOutputStream(byteOutput);
|
||||
objectOutput.writeByte(SmartMovingInfo.SoundPacketId);
|
||||
objectOutput.writeObject(soundId);
|
||||
objectOutput.writeFloat(volume);
|
||||
objectOutput.writeFloat(pitch);
|
||||
objectOutput.flush();
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
comm.sendPacket(byteOutput.toByteArray());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,355 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.smart.moving.config.*;
|
||||
import net.smart.properties.*;
|
||||
|
||||
public class SmartMovingServer
|
||||
{
|
||||
public static final float SmallSizeItemGrabHeight = 0.25F;
|
||||
|
||||
protected final IEntityPlayerMP mp;
|
||||
private boolean resetFallDistance = false;
|
||||
private boolean resetTicksForFloatKick = false;
|
||||
private boolean initialized = false;
|
||||
private boolean withinOnLivingUpdate = false;
|
||||
|
||||
public boolean crawlingInitialized;
|
||||
public int crawlingCooldown;
|
||||
public boolean isCrawling;
|
||||
public boolean isSmall;
|
||||
public float hunger;
|
||||
|
||||
private int disableAddExhaustionDepth;
|
||||
private boolean disableAddExhaustion;
|
||||
private boolean isSneakButtonPressed;
|
||||
private Boolean forceIsSneaking;
|
||||
|
||||
public SmartMovingServer(IEntityPlayerMP mp, boolean onTheFly)
|
||||
{
|
||||
this.mp = mp;
|
||||
if (onTheFly)
|
||||
initialize(true);
|
||||
}
|
||||
|
||||
public void initialize(boolean alwaysSendMessage)
|
||||
{
|
||||
if(Options._globalConfig.value)
|
||||
SmartMovingPacketStream.sendConfigContent(mp, optionsHandler.writeToProperties(), null);
|
||||
else if(Options._serverConfig.value)
|
||||
SmartMovingPacketStream.sendConfigContent(mp, optionsHandler.writeToProperties(mp, false), null);
|
||||
else if(alwaysSendMessage)
|
||||
SmartMovingPacketStream.sendConfigContent(mp, Options.enabled ? new String[0] : null, null);
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public void processStatePacket(FMLProxyPacket packet, long state)
|
||||
{
|
||||
if(!initialized)
|
||||
initialize(false);
|
||||
|
||||
boolean isCrawling = ((state >>> 13) & 1) != 0;
|
||||
setCrawling(isCrawling);
|
||||
|
||||
boolean isSmall = ((state >>> 15) & 1) != 0;
|
||||
setSmall(isSmall);
|
||||
|
||||
boolean isClimbing = ((state >>> 14) & 1) != 0;
|
||||
boolean isCrawlClimbing = ((state >>> 12) & 1) != 0;
|
||||
boolean isCeilingClimbing = ((state >>> 18) & 1) != 0;
|
||||
|
||||
boolean isWallJumping = ((state >>> 31) & 1) != 0;
|
||||
|
||||
isSneakButtonPressed = ((state >>> 33) & 1) != 0;
|
||||
|
||||
resetFallDistance = isClimbing || isCrawlClimbing || isCeilingClimbing || isWallJumping;
|
||||
resetTicksForFloatKick = isClimbing || isCrawlClimbing || isCeilingClimbing;
|
||||
mp.sendPacketToTrackedPlayers(packet);
|
||||
}
|
||||
|
||||
public void processConfigPacket(String clientConfigurationVersion)
|
||||
{
|
||||
boolean warn = true;
|
||||
String type = "unknown";
|
||||
if(clientConfigurationVersion != null)
|
||||
for(int i = 0; i < SmartMovingConfig._all.length; i++)
|
||||
if(clientConfigurationVersion.equals(SmartMovingConfig._all[i]))
|
||||
{
|
||||
warn = i > 0;
|
||||
type = warn ? "outdated" : "matching";
|
||||
break;
|
||||
}
|
||||
|
||||
String message = "Smart Moving player \"" + mp.getUsername() + "\" connected with " + type + " configuration system";
|
||||
if(clientConfigurationVersion != null)
|
||||
message += " version \"" + clientConfigurationVersion + "\"";
|
||||
|
||||
if(warn)
|
||||
FMLLog.warning(message);
|
||||
else
|
||||
FMLLog.info(message);
|
||||
}
|
||||
|
||||
public void processConfigChangePacket(String localUserName)
|
||||
{
|
||||
if(!Options._globalConfig.value)
|
||||
{
|
||||
toggleSingleConfig();
|
||||
return;
|
||||
}
|
||||
|
||||
String username = mp.getUsername();
|
||||
|
||||
if(localUserName == username)
|
||||
{
|
||||
toggleConfig();
|
||||
return;
|
||||
}
|
||||
|
||||
String[] rightPlayerNames = Options._usersWithChangeConfigRights.value;
|
||||
for(int i=0; i<rightPlayerNames.length; i++)
|
||||
if(rightPlayerNames[i].equals(username))
|
||||
{
|
||||
toggleConfig();
|
||||
return;
|
||||
}
|
||||
|
||||
SmartMovingPacketStream.sendConfigChange(mp);
|
||||
}
|
||||
|
||||
public void processSpeedChangePacket(int difference, String localUserName)
|
||||
{
|
||||
if(!Options._globalConfig.value)
|
||||
{
|
||||
changeSingleSpeed(difference);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!hasRight(localUserName, Options._usersWithChangeSpeedRights))
|
||||
SmartMovingPacketStream.sendSpeedChange(mp, 0, null);
|
||||
else
|
||||
changeSpeed(difference);
|
||||
}
|
||||
|
||||
public void processHungerChangePacket(float hunger)
|
||||
{
|
||||
this.hunger = hunger;
|
||||
}
|
||||
|
||||
public void processSoundPacket(String soundId, float volume, float pitch)
|
||||
{
|
||||
mp.localPlaySound(soundId, volume, pitch);
|
||||
}
|
||||
|
||||
private boolean hasRight(String localUserName, Property<String[]> rights)
|
||||
{
|
||||
String username = mp.getUsername();
|
||||
|
||||
if(localUserName == username)
|
||||
return true;
|
||||
|
||||
String[] rightPlayerNames = rights.value;
|
||||
for(int i=0; i<rightPlayerNames.length; i++)
|
||||
if(rightPlayerNames[i].equals(username))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void toggleSingleConfig()
|
||||
{
|
||||
SmartMovingPacketStream.sendConfigContent(mp, optionsHandler.writeToProperties(mp, true), mp.getUsername());
|
||||
}
|
||||
|
||||
public void toggleConfig()
|
||||
{
|
||||
optionsHandler.toggle(mp);
|
||||
String[] config = optionsHandler.writeToProperties();
|
||||
IEntityPlayerMP[] players = mp.getAllPlayers();
|
||||
for(int n=0; n<players.length; n++)
|
||||
SmartMovingPacketStream.sendConfigContent(players[n], config, mp.getUsername());
|
||||
}
|
||||
|
||||
public void changeSingleSpeed(int difference)
|
||||
{
|
||||
optionsHandler.changeSingleSpeed(mp, difference);
|
||||
SmartMovingPacketStream.sendSpeedChange(mp, difference, mp.getUsername());
|
||||
}
|
||||
|
||||
public void changeSpeed(int difference)
|
||||
{
|
||||
optionsHandler.changeSpeed(difference, mp);
|
||||
IEntityPlayerMP[] players = mp.getAllPlayers();
|
||||
for(int n=0; n<players.length; n++)
|
||||
SmartMovingPacketStream.sendSpeedChange(players[n], difference, mp.getUsername());
|
||||
}
|
||||
|
||||
public void afterOnUpdate()
|
||||
{
|
||||
if(resetFallDistance)
|
||||
mp.resetFallDistance();
|
||||
if(resetTicksForFloatKick)
|
||||
mp.resetTicksForFloatKick();
|
||||
}
|
||||
|
||||
public static void initialize(File optionsPath, int gameType, SmartMovingConfig config)
|
||||
{
|
||||
Options = config;
|
||||
optionsHandler = new SmartMovingServerOptions(Options, optionsPath, gameType);
|
||||
FMLLog.getLogger().info(SmartMovingInfo.ModComMessage);
|
||||
}
|
||||
|
||||
public void setCrawling(boolean crawling)
|
||||
{
|
||||
if(!crawling && isCrawling)
|
||||
crawlingCooldown = 10;
|
||||
isCrawling = crawling;
|
||||
}
|
||||
|
||||
public void setSmall(boolean isSmall)
|
||||
{
|
||||
mp.setHeight(isSmall ? 0.8F : 1.8F);
|
||||
this.isSmall = isSmall;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void afterSetPosition(double d, double d1, double d2)
|
||||
{
|
||||
if(!crawlingInitialized)
|
||||
mp.setMaxY(mp.getMinY() + mp.getHeight() - 1);
|
||||
}
|
||||
|
||||
public void beforeIsPlayerSleeping()
|
||||
{
|
||||
if(!crawlingInitialized)
|
||||
{
|
||||
mp.setMaxY(mp.getMinY() + mp.getHeight());
|
||||
crawlingInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void beforeOnUpdate()
|
||||
{
|
||||
if (crawlingCooldown > 0)
|
||||
crawlingCooldown --;
|
||||
}
|
||||
|
||||
public void beforeOnLivingUpdate()
|
||||
{
|
||||
withinOnLivingUpdate = true;
|
||||
}
|
||||
|
||||
public void afterOnLivingUpdate()
|
||||
{
|
||||
withinOnLivingUpdate = false;
|
||||
|
||||
if(!isSmall)
|
||||
return;
|
||||
|
||||
if (mp.doGetHealth() <= 0)
|
||||
return;
|
||||
|
||||
double offset = SmallSizeItemGrabHeight;
|
||||
AxisAlignedBB box = mp.expandBox(mp.getBox(), 1, offset, 1);
|
||||
|
||||
List<?> offsetEntities = mp.getEntitiesExcludingPlayer(box);
|
||||
if (offsetEntities != null && offsetEntities.size() > 0)
|
||||
{
|
||||
Object[] offsetEntityArray = offsetEntities.toArray();
|
||||
|
||||
box = mp.expandBox(box, 0, -offset, 0);
|
||||
List<?> standardEntities = mp.getEntitiesExcludingPlayer(box);
|
||||
|
||||
for (int i=0; i<offsetEntityArray.length; i++)
|
||||
{
|
||||
Entity offsetEntity = (Entity)offsetEntityArray[i];
|
||||
if(standardEntities != null && standardEntities.contains(offsetEntity))
|
||||
continue;
|
||||
|
||||
if (!mp.isDeadEntity(offsetEntity))
|
||||
mp.onCollideWithPlayer(offsetEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEntityInsideOpaqueBlock()
|
||||
{
|
||||
if(crawlingCooldown > 0)
|
||||
return false;
|
||||
|
||||
return mp.localIsEntityInsideOpaqueBlock();
|
||||
}
|
||||
|
||||
public void addMovementStat(double var1, double var3, double var5)
|
||||
{
|
||||
beforeAddMovingHungerBatch();
|
||||
mp.localAddMovementStat(var1, var3, var5);
|
||||
if(disableAddExhaustion && hunger != 0 && !withinOnLivingUpdate)
|
||||
mp.localAddExhaustion(hunger);
|
||||
afterAddMovingHungerBatch();
|
||||
}
|
||||
|
||||
public void beforeAddMovingHungerBatch()
|
||||
{
|
||||
disableAddExhaustionDepth++;
|
||||
if(hunger != -1)
|
||||
disableAddExhaustion = true;
|
||||
}
|
||||
|
||||
public void addExhaustion(float exhaustion)
|
||||
{
|
||||
if(!disableAddExhaustion)
|
||||
mp.localAddExhaustion(exhaustion);
|
||||
}
|
||||
|
||||
public void afterAddMovingHungerBatch()
|
||||
{
|
||||
disableAddExhaustionDepth--;
|
||||
if(disableAddExhaustionDepth == 0)
|
||||
disableAddExhaustion = false;
|
||||
}
|
||||
|
||||
public boolean isSneaking()
|
||||
{
|
||||
if(forceIsSneaking != null)
|
||||
return forceIsSneaking;
|
||||
|
||||
return mp.localIsSneaking();
|
||||
}
|
||||
|
||||
public void beforeActivateBlockOrUseItem()
|
||||
{
|
||||
forceIsSneaking = isSneakButtonPressed;
|
||||
}
|
||||
|
||||
public void afterActivateBlockOrUseItem()
|
||||
{
|
||||
forceIsSneaking = null;
|
||||
}
|
||||
|
||||
public static SmartMovingConfig Options = null;
|
||||
private static SmartMovingServerOptions optionsHandler = null;
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
|
||||
public class SmartMovingServerComm implements IPacketReceiver
|
||||
{
|
||||
public static ILocalUserNameProvider localUserNameProvider = null;
|
||||
|
||||
@Override
|
||||
public boolean processStatePacket(FMLProxyPacket packet, IEntityPlayerMP player, int entityId, long state)
|
||||
{
|
||||
player.getMoving().processStatePacket(packet, state);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigInfoPacket(FMLProxyPacket packet, IEntityPlayerMP player, String info)
|
||||
{
|
||||
player.getMoving().processConfigPacket(info);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigContentPacket(FMLProxyPacket packet, IEntityPlayerMP player, String[] content, String username)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConfigChangePacket(FMLProxyPacket packet, IEntityPlayerMP player)
|
||||
{
|
||||
player.getMoving().processConfigChangePacket(localUserNameProvider != null ? localUserNameProvider.getLocalConfigUserName() : null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processSpeedChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, int difference, String username)
|
||||
{
|
||||
player.getMoving().processSpeedChangePacket(difference, localUserNameProvider != null ? localUserNameProvider.getLocalSpeedUserName() : null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processHungerChangePacket(FMLProxyPacket packet, IEntityPlayerMP player, float hunger)
|
||||
{
|
||||
player.getMoving().processHungerChangePacket(hunger);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processSoundPacket(FMLProxyPacket packet, IEntityPlayerMP player, String soundId, float volume, float pitch)
|
||||
{
|
||||
player.getMoving().processSoundPacket(soundId, volume, pitch);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final SmartMovingServerComm instance = new SmartMovingServerComm();
|
||||
}
|
||||
@@ -1,596 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
public class SmartMovingClientConfig extends SmartMovingConfig
|
||||
{
|
||||
public boolean isSneakingEnabled()
|
||||
{
|
||||
return _sneak.value || !enabled;
|
||||
}
|
||||
|
||||
public boolean isStandardBaseClimb()
|
||||
{
|
||||
return _isStandardBaseClimb.value || !enabled;
|
||||
}
|
||||
|
||||
public boolean isSimpleBaseClimb()
|
||||
{
|
||||
return _isSimpleBaseClimb.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isSmartBaseClimb()
|
||||
{
|
||||
return _isSmartBaseClimb.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isFreeBaseClimb()
|
||||
{
|
||||
return _isFreeBaseClimb.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isTotalFreeLadderClimb()
|
||||
{
|
||||
return isFreeBaseClimb() && _freeBaseLadderClimb.value;
|
||||
}
|
||||
|
||||
public boolean isTotalFreeVineClimb()
|
||||
{
|
||||
return isFreeBaseClimb() && _freeBaseVineClimb.value;
|
||||
}
|
||||
|
||||
public boolean isFreeClimbAutoLaddderEnabled()
|
||||
{
|
||||
return _freeClimbingAutoLaddder.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isFreeClimbAutoVineEnabled()
|
||||
{
|
||||
return _freeClimbingAutoVine.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isFreeClimbingEnabled()
|
||||
{
|
||||
return _freeClimb.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isCeilingClimbingEnabled()
|
||||
{
|
||||
return _ceilingClimbing.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isSwimmingEnabled()
|
||||
{
|
||||
return _swim.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isDivingEnabled()
|
||||
{
|
||||
return _dive.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isLavaLikeWaterEnabled()
|
||||
{
|
||||
return _lavaLikeWater.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isFlyingEnabled()
|
||||
{
|
||||
return _fly.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isLevitateSmallEnabled()
|
||||
{
|
||||
return this._levitateSmall.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isRunningEnabled()
|
||||
{
|
||||
return _run.value || !enabled;
|
||||
}
|
||||
|
||||
public boolean isRunExhaustionEnabled()
|
||||
{
|
||||
return _runExhaustion.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isClimbExhaustionEnabled()
|
||||
{
|
||||
return _climbExhaustion.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isCeilingClimbExhaustionEnabled()
|
||||
{
|
||||
return _ceilingClimbExhaustion.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isSprintingEnabled()
|
||||
{
|
||||
return _sprint.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isSprintExhaustionEnabled()
|
||||
{
|
||||
return _sprintExhaustion.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isJumpChargingEnabled()
|
||||
{
|
||||
return _jumpCharge.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isHeadJumpingEnabled()
|
||||
{
|
||||
return _headJump.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isSlidingEnabled()
|
||||
{
|
||||
return _slide.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isCrawlingEnabled()
|
||||
{
|
||||
return _crawl.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isExhaustionLossHungerEnabled()
|
||||
{
|
||||
return _exhaustionLossHunger.value && _hungerGain.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isHungerGainEnabled()
|
||||
{
|
||||
return _hungerGain.value || !enabled;
|
||||
}
|
||||
|
||||
public boolean isLevitationAnimationEnabled()
|
||||
{
|
||||
return _levitateAnimation.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isFallAnimationEnabled()
|
||||
{
|
||||
return _fallAnimation.value && enabled;
|
||||
}
|
||||
|
||||
public final static int Sprinting = 0;
|
||||
public final static int Running = 1;
|
||||
public final static int Walking = 2;
|
||||
public final static int Sneaking = 3;
|
||||
public final static int Standing = 4;
|
||||
|
||||
public final static int Up = 0;
|
||||
public final static int ChargeUp = 1;
|
||||
public final static int Angle = 2;
|
||||
public final static int HeadUp = 3;
|
||||
public final static int SlideDown = 4;
|
||||
public final static int ClimbUp = 5;
|
||||
public final static int ClimbUpHandsOnly = 6;
|
||||
public final static int ClimbBackUp = 7;
|
||||
public final static int ClimbBackUpHandsOnly = 8;
|
||||
public final static int ClimbBackHead = 9;
|
||||
public final static int ClimbBackHeadHandsOnly = 10;
|
||||
public final static int WallUp = 11;
|
||||
public final static int WallHead = 12;
|
||||
public final static int WallUpSlide = 13;
|
||||
public final static int WallHeadSlide = 14;
|
||||
|
||||
public boolean isJumpingEnabled(int speed, int type)
|
||||
{
|
||||
if(!enabled)
|
||||
return true;
|
||||
|
||||
if(type == ChargeUp)
|
||||
return _jumpCharge.value;
|
||||
if(type == SlideDown)
|
||||
return _slide.value;
|
||||
if(type == ClimbUp || type == ClimbUpHandsOnly)
|
||||
return _climbUpJump.value;
|
||||
if(type == ClimbBackUp || type == ClimbBackUpHandsOnly)
|
||||
return _climbBackUpJump.value;
|
||||
if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
return _climbBackHeadJump.value;
|
||||
|
||||
if(type == WallUp)
|
||||
return _wallUpJump.value;
|
||||
if(type == WallHead)
|
||||
return _wallHeadJump.value;
|
||||
|
||||
if(speed == Sprinting)
|
||||
return _sprintJump.value;
|
||||
else if(speed == Running)
|
||||
return _runJump.value;
|
||||
else if(speed == Walking)
|
||||
return _walkJump.value;
|
||||
else if(speed == Sneaking)
|
||||
return _sneakJump.value;
|
||||
else if(speed == Standing)
|
||||
return _standJump.value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isSideJumpEnabled()
|
||||
{
|
||||
return enabled && this._angleJumpSide.value;
|
||||
}
|
||||
|
||||
public boolean isBackJumpEnabled()
|
||||
{
|
||||
return enabled && this._angleJumpBack.value;
|
||||
}
|
||||
|
||||
public boolean isWallJumpEnabled()
|
||||
{
|
||||
return enabled && this._wallUpJump.value;
|
||||
}
|
||||
|
||||
public boolean isJumpExhaustionEnabled(int speed, int type)
|
||||
{
|
||||
if(!enabled)
|
||||
return false;
|
||||
|
||||
boolean result = _jumpExhaustion.value;
|
||||
|
||||
if(type == SlideDown)
|
||||
return result && _jumpSlideExhaustion.value;
|
||||
else if(type == Angle)
|
||||
result &= _angleJumpExhaustion.value;
|
||||
else if(type == ClimbUp || type == ClimbUpHandsOnly)
|
||||
result &= _climbJumpUpExhaustion.value;
|
||||
else if(type == ClimbBackUp || type == ClimbBackUpHandsOnly )
|
||||
result &= _climbJumpBackUpExhaustion.value;
|
||||
else if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
result &= _climbJumpBackHeadExhaustion.value;
|
||||
else if(type == WallUp)
|
||||
result &= _wallUpJumpExhaustion.value;
|
||||
else if(type == WallHead)
|
||||
result &= _wallHeadJumpExhaustion.value;
|
||||
else
|
||||
result &= _upJumpExhaustion.value;
|
||||
|
||||
if(type == ClimbUp || type == ClimbUpHandsOnly || type == ClimbBackUp || type == ClimbBackUpHandsOnly || type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
return result && _climbJumpExhaustion.value;
|
||||
|
||||
if(type == WallUp || type == WallHead)
|
||||
return result && _wallJumpExhaustion.value;
|
||||
|
||||
if(speed == Sprinting)
|
||||
result &= _sprintJumpExhaustion.value;
|
||||
else if(speed == Running)
|
||||
result &= _runJumpExhaustion.value;
|
||||
else if(speed == Walking)
|
||||
result &= _walkJumpExhaustion.value;
|
||||
else if(speed == Sneaking)
|
||||
result &= _sneakJumpExhaustion.value;
|
||||
else if(speed == Standing)
|
||||
result &= _standJumpExhaustion.value;
|
||||
|
||||
if(type == ChargeUp)
|
||||
result |= _jumpChargeExhaustion.value;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public float getJumpExhaustionGain(int speed, int type, float jumpCharge)
|
||||
{
|
||||
if(!enabled)
|
||||
return 0F;
|
||||
|
||||
float result = _baseExhautionGainFactor.value * _jumpExhaustionGainFactor.value;
|
||||
|
||||
if(type == SlideDown)
|
||||
return result * _jumpSlideExhaustionGainFactor.value;
|
||||
else if(type == Angle)
|
||||
result *= _angleJumpExhaustionGainFactor.value;
|
||||
else if(type == ClimbUp || type == ClimbUpHandsOnly)
|
||||
result *= _climbJumpUpExhaustionGainFactor.value;
|
||||
else if(type == ClimbBackUp || type == ClimbBackUpHandsOnly)
|
||||
result *= _climbJumpBackUpExhaustionGainFactor.value;
|
||||
else if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbJumpBackHeadExhaustionGainFactor.value;
|
||||
else if(type == WallUp)
|
||||
result *= _wallUpJumpExhaustionGainFactor.value;
|
||||
else if(type == WallHead)
|
||||
result *= _wallHeadJumpExhaustionGainFactor.value;
|
||||
else
|
||||
result *= _upJumpExhaustionGainFactor.value;
|
||||
|
||||
if(type == ClimbUp || type == ClimbUpHandsOnly || type == ClimbBackUp || type == ClimbBackUpHandsOnly || type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
return result * _climbJumpExhaustionGainFactor.value;
|
||||
|
||||
if(type == WallUp || type == WallHead)
|
||||
return result * _wallJumpExhaustionGainFactor.value;
|
||||
|
||||
if(speed == Sprinting)
|
||||
result *= _sprintJumpExhaustionGainFactor.value;
|
||||
else if(speed == Running)
|
||||
result *= _runJumpExhaustionGainFactor.value;
|
||||
else if(speed == Walking)
|
||||
result *= _walkJumpExhaustionGainFactor.value;
|
||||
else if(speed == Sneaking)
|
||||
result *= _sneakJumpExhaustionGainFactor.value;
|
||||
else if(speed == Standing)
|
||||
result *= _standJumpExhaustionGainFactor.value;
|
||||
|
||||
if(type == ChargeUp)
|
||||
{
|
||||
if(!isJumpExhaustionEnabled(speed, Up))
|
||||
result = 0;
|
||||
|
||||
result +=
|
||||
_baseExhautionGainFactor.value *
|
||||
_jumpExhaustionGainFactor.value *
|
||||
_upJumpExhaustionGainFactor.value *
|
||||
_jumpChargeExhaustionGainFactor.value *
|
||||
Math.min(jumpCharge, _jumpChargeMaximum.value) / _jumpChargeMaximum.value;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public float getJumpExhaustionStop(int speed, int type, float jumpCharge)
|
||||
{
|
||||
float result = _jumpExhaustionStopFactor.value;
|
||||
|
||||
if(type == SlideDown)
|
||||
return result * _jumpSlideExhaustionStopFactor.value;
|
||||
else if(type == Angle)
|
||||
result *= _angleJumpExhaustionStopFactor.value;
|
||||
else if(type == ClimbUp || type == ClimbUpHandsOnly)
|
||||
result *= _climbJumpUpExhaustionStopFactor.value;
|
||||
else if(type == ClimbBackUp || type == ClimbBackUpHandsOnly)
|
||||
result *= _climbJumpBackUpExhaustionStopFactor.value;
|
||||
else if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbJumpBackHeadExhaustionStopFactor.value;
|
||||
else if(type == WallUp)
|
||||
result *= _wallUpJumpExhaustionStopFactor.value;
|
||||
else if(type == WallHead)
|
||||
result *= _wallHeadJumpExhaustionStopFactor.value;
|
||||
else
|
||||
result *= _upJumpExhaustionStopFactor.value;
|
||||
|
||||
if(type == ClimbUp || type == ClimbUpHandsOnly || type == ClimbBackUp || type == ClimbBackUpHandsOnly || type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
return result * _climbJumpExhaustionStopFactor.value;
|
||||
|
||||
if(type == WallUp || type == WallHead)
|
||||
return result * _wallJumpExhaustionStopFactor.value;
|
||||
|
||||
if(speed == Sprinting)
|
||||
result *= _sprintJumpExhaustionStopFactor.value;
|
||||
else if(speed == Running)
|
||||
result *= _runJumpExhaustionStopFactor.value;
|
||||
else if(speed == Walking)
|
||||
result *= _walkJumpExhaustionStopFactor.value;
|
||||
else if(speed == Sneaking)
|
||||
result *= _sneakJumpExhaustionStopFactor.value;
|
||||
else if(speed == Standing)
|
||||
result *= _standJumpExhaustionStopFactor.value;
|
||||
|
||||
if(type == ChargeUp)
|
||||
{
|
||||
if(!isJumpExhaustionEnabled(speed, Up))
|
||||
result += getJumpExhaustionGain(speed, Up, 0);
|
||||
|
||||
result -=
|
||||
_jumpExhaustionStopFactor.value *
|
||||
_upJumpExhaustionStopFactor.value *
|
||||
_jumpChargeExhaustionStopFactor.value *
|
||||
Math.min(jumpCharge, _jumpChargeMaximum.value) / _jumpChargeMaximum.value;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public float getJumpChargeFactor(float jumpCharge)
|
||||
{
|
||||
if(!enabled || !_jumpCharge.value)
|
||||
return 1F;
|
||||
|
||||
jumpCharge = Math.min(jumpCharge, _jumpChargeMaximum.value);
|
||||
return 1F + jumpCharge / _jumpChargeMaximum.value * (_jumpChargeFactor.value - 1F);
|
||||
}
|
||||
|
||||
public float getHeadJumpFactor(float headJumpCharge)
|
||||
{
|
||||
if(!enabled || !_headJump.value)
|
||||
return 1F;
|
||||
headJumpCharge = Math.min(headJumpCharge, _headJumpChargeMaximum.value);
|
||||
return (headJumpCharge - 1) / (_headJumpChargeMaximum.value - 1);
|
||||
}
|
||||
|
||||
public float getJumpVerticalFactor(int speed, int type)
|
||||
{
|
||||
if(!enabled)
|
||||
return 1F;
|
||||
|
||||
float result = _jumpVerticalFactor.value;
|
||||
|
||||
if(type == Angle)
|
||||
return result * _angleJumpVerticalFactor .value;
|
||||
|
||||
if(type == ClimbUp || type == ClimbUpHandsOnly)
|
||||
result *= _climbUpJumpVerticalFactor.value;
|
||||
if(type == ClimbUpHandsOnly)
|
||||
result *= _climbUpJumpHandsOnlyVerticalFactor.value;
|
||||
|
||||
if(type == ClimbBackUp || type == ClimbBackUpHandsOnly)
|
||||
result *= _climbBackUpJumpVerticalFactor.value;
|
||||
if(type == ClimbBackUpHandsOnly)
|
||||
result *= _climbBackUpJumpHandsOnlyVerticalFactor.value;
|
||||
|
||||
if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbBackHeadJumpVerticalFactor.value;
|
||||
if(type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbBackHeadJumpHandsOnlyVerticalFactor.value;
|
||||
|
||||
if(type == WallUp || type == WallHead)
|
||||
result *= _wallUpJumpVerticalFactor.value;
|
||||
if(type == WallHead)
|
||||
result *= _wallHeadJumpVerticalFactor.value;
|
||||
|
||||
if(type == Angle || type == ClimbUp || type == ClimbUpHandsOnly || type == ClimbBackUp || type == ClimbBackUpHandsOnly || type == ClimbBackHead || type == ClimbBackHeadHandsOnly || type == WallUp || type == WallHead)
|
||||
return result;
|
||||
|
||||
if(speed == Sprinting)
|
||||
result *= _sprintJumpVerticalFactor.value;
|
||||
else if(speed == Running)
|
||||
result *= _runJumpVerticalFactor.value;
|
||||
else if(speed == Walking)
|
||||
result *= _walkJumpVerticalFactor.value;
|
||||
else if(speed == Sneaking)
|
||||
result *= _sneakJumpVerticalFactor.value;
|
||||
else if(speed == Standing)
|
||||
result *= _standJumpVerticalFactor.value;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public float getJumpHorizontalFactor(int speed, int type)
|
||||
{
|
||||
if(!enabled)
|
||||
return speed == Running ? 2F : 1F;
|
||||
|
||||
float result = _jumpHorizontalFactor.value;
|
||||
|
||||
if(type == Angle)
|
||||
result *= _angleJumpHorizontalFactor.value;
|
||||
|
||||
if(type == ClimbBackUp || type == ClimbBackUpHandsOnly)
|
||||
result *= _climbBackUpJumpHorizontalFactor.value;
|
||||
if(type == ClimbBackUpHandsOnly)
|
||||
result *= _climbBackUpJumpHandsOnlyHorizontalFactor.value;
|
||||
|
||||
if(type == ClimbBackHead || type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbBackHeadJumpHorizontalFactor.value;
|
||||
if(type == ClimbBackHeadHandsOnly)
|
||||
result *= _climbBackHeadJumpHandsOnlyHorizontalFactor.value;
|
||||
|
||||
if(type == WallUp)
|
||||
result *= _wallUpJumpHorizontalFactor.value;
|
||||
if(type == WallHead)
|
||||
result *= _wallHeadJumpHorizontalFactor.value;
|
||||
|
||||
if(type == Angle || type == ClimbUp || type == ClimbUpHandsOnly || type == ClimbBackUp || type == ClimbBackUpHandsOnly || type == ClimbBackHead || type == ClimbBackHeadHandsOnly || type == WallUp || type == WallHead)
|
||||
return result;
|
||||
|
||||
if(speed == Sprinting)
|
||||
result *= _sprintJumpHorizontalFactor.value;
|
||||
else if(speed == Running)
|
||||
result *= _runJumpHorizontalFactor.value;
|
||||
else if(speed == Walking)
|
||||
result *= _walkJumpHorizontalFactor.value;
|
||||
else if(speed == Sneaking)
|
||||
result *= _sneakJumpHorizontalFactor.value;
|
||||
else if(speed == Standing && type != ClimbBackUp && type != ClimbBackUpHandsOnly && type != ClimbBackHead && type != ClimbBackHeadHandsOnly)
|
||||
result *= 0F;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public float getMaxHorizontalMotion(int speed, int type, boolean inWater)
|
||||
{
|
||||
float maxMotion = 0.117852041920949F;
|
||||
if(!enabled)
|
||||
return speed == Running ? maxMotion * 1.3F : maxMotion;
|
||||
|
||||
if(inWater)
|
||||
maxMotion = 0.07839602977037292F;
|
||||
|
||||
if(speed == Sprinting)
|
||||
maxMotion *= _sprintFactor.value;
|
||||
else if(speed == Running)
|
||||
maxMotion *= _runFactor.value;
|
||||
else if(speed == Sneaking)
|
||||
maxMotion *= _sneakFactor.value;
|
||||
|
||||
return maxMotion;
|
||||
}
|
||||
|
||||
public float getMaxExhaustion()
|
||||
{
|
||||
float result = 0F;
|
||||
if(_run.value && _runExhaustion.value)
|
||||
result = max(result, _runExhaustionStop.value);
|
||||
if(_sprint.value && _sprintExhaustion.value)
|
||||
result = max(result, _sprintExhaustionStop.value);
|
||||
|
||||
if(_jump.value)
|
||||
for(int i = Sprinting; i <= Standing; i++)
|
||||
for(int n = Up; n <= WallHeadSlide; n++)
|
||||
if(isJumpExhaustionEnabled(i, n))
|
||||
for(int t = 0; t <= 1; t++)
|
||||
result = max(result, getJumpExhaustionStop(i, n, t) + getJumpExhaustionGain(i, n, t));
|
||||
|
||||
if(_freeClimb.value && _climbExhaustion.value)
|
||||
result = max(result, _climbExhaustionStop.value);
|
||||
if(_ceilingClimbing.value && _ceilingClimbExhaustion.value)
|
||||
result = max(result, _ceilingClimbExhaustionStop.value);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static float max(float value, float valueOrInfinite)
|
||||
{
|
||||
return valueOrInfinite == java.lang.Float.POSITIVE_INFINITY ? value : Math.max(value, valueOrInfinite);
|
||||
}
|
||||
|
||||
public float getFactor(boolean hunger, boolean onGround, boolean isStanding, boolean isStill, boolean isSneaking, boolean isRunning, boolean isSprinting, boolean isClimbing, boolean isClimbCrawling, boolean isCeilingClimbing, boolean isDipping, boolean isSwimming, boolean isDiving, boolean isCrawling, boolean isCrawlClimbing)
|
||||
{
|
||||
isClimbing |= isClimbCrawling;
|
||||
isCrawling |= isCrawlClimbing;
|
||||
boolean actionOverGound = isClimbing || isCeilingClimbing || isDiving || isSwimming;
|
||||
boolean airBorne = !onGround && !actionOverGound;
|
||||
isStanding = actionOverGound ? isStill : isStanding;
|
||||
isSneaking = isSneaking & !isStanding;
|
||||
|
||||
float factor = hunger ? _baseHungerGainFactor.value : _baseExhautionLossFactor.value;
|
||||
if(airBorne)
|
||||
factor *= hunger ? 0F : _fallExhautionLossFactor.value;
|
||||
else if(isSprinting)
|
||||
factor *= hunger ? _sprintingHungerGainFactor.value : _sprintingExhautionLossFactor.value;
|
||||
else if(isRunning)
|
||||
factor *= hunger ? _runningHungerGainFactor.value : _runningExhautionLossFactor.value;
|
||||
else if(isSneaking)
|
||||
factor *= hunger ? _sneakingHungerGainFactor.value : _sneakingExhautionLossFactor.value;
|
||||
else if(isStanding)
|
||||
factor *= hunger ? _standingHungerGainFactor.value : _standingExhautionLossFactor.value;
|
||||
else
|
||||
factor *= hunger ? _walkingHungerGainFactor.value : _walkingExhautionLossFactor.value;
|
||||
|
||||
if(isClimbing)
|
||||
factor *= hunger ? _climbingHungerGainFactor.value : _climbingExhaustionLossFactor.value;
|
||||
else if(isCrawling)
|
||||
factor *= hunger ? _crawlingHungerGainFactor.value : _crawlingExhaustionLossFactor.value;
|
||||
else if(isCeilingClimbing)
|
||||
factor *= hunger ? _ceilClimbingHungerGainFactor.value : _ceilClimbingExhaustionLossFactor.value;
|
||||
else if(isSwimming)
|
||||
factor *= hunger ? _swimmingHungerGainFactor.value : _swimmingExhaustionLossFactor.value;
|
||||
else if(isDiving)
|
||||
factor *= hunger ? _divingHungerGainFactor.value : _divingExhaustionLossFactor.value;
|
||||
else if(isDipping)
|
||||
factor *= hunger ? _dippingHungerGainFactor.value : _dippingExhaustionLossFactor.value;
|
||||
else if(onGround)
|
||||
factor *= hunger ? _normalHungerGainFactor.value : _normalExhaustionLossFactor.value;
|
||||
else
|
||||
factor *= hunger ? _normalHungerGainFactor.value : _normalExhaustionLossFactor.value;
|
||||
|
||||
return factor;
|
||||
}
|
||||
}
|
||||
@@ -1,647 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
|
||||
import net.smart.properties.*;
|
||||
import net.smart.properties.Properties;
|
||||
|
||||
public class SmartMovingConfig extends SmartMovingProperties
|
||||
{
|
||||
private static final String _smartLadderClimbingSpeedPropertiesFileName = "smart_ladder_climbing_speed_options.txt";
|
||||
private static final String _smartClimbingPropertiesFileName = "smart_climbing_options.txt";
|
||||
private static final String _smartMovingPropertiesFileName = "smart_moving_options.txt";
|
||||
private static final String _smartMovingClientServerPropertiesFileName = "smart_moving_server_options.txt";
|
||||
|
||||
private static final String _slcs = "0.1";
|
||||
private static final String _sc = "0.2";
|
||||
private static final String _sm_1_0 = "1.0";
|
||||
private static final String _sm_1_1 = "1.1";
|
||||
private static final String _sm_1_2 = "1.2";
|
||||
private static final String _sm_1_3 = "1.3";
|
||||
private static final String _sm_1_4 = "1.4";
|
||||
private static final String _sm_1_5 = "1.5";
|
||||
private static final String _sm_1_6 = "1.6";
|
||||
private static final String _sm_1_7 = "1.7";
|
||||
private static final String _sm_1_8 = "1.8";
|
||||
private static final String _sm_1_9 = "1.9";
|
||||
private static final String _sm_1_10 = "1.10";
|
||||
private static final String _sm_1_11 = "1.11";
|
||||
public static final String _sm_2_0 = "2.0";
|
||||
public static final String _sm_2_1 = "2.1";
|
||||
public static final String _sm_2_2 = "2.2";
|
||||
public static final String _sm_2_3 = "2.3";
|
||||
public static final String _sm_2_4 = "2.4";
|
||||
public static final String _sm_2_5 = "2.5";
|
||||
public static final String _sm_2_6 = "2.6";
|
||||
public static final String _sm_3_0 = "3.0";
|
||||
public static final String _sm_3_1 = "3.1";
|
||||
public static final String _sm_3_2 = "3.2";
|
||||
public static final String _sm_current = _sm_3_2;
|
||||
|
||||
private static final String[] _all_sm = new String[] { _sm_3_2, _sm_3_1, _sm_3_0, _sm_2_6, _sm_2_5, _sm_2_4, _sm_2_3, _sm_2_2, _sm_2_1, _sm_2_0, _sm_1_11, _sm_1_10, _sm_1_9, _sm_1_8, _sm_1_7, _sm_1_6, _sm_1_5, _sm_1_4, _sm_1_3, _sm_1_2, _sm_1_1, _sm_1_0 };
|
||||
private static final String[] _all_old = new String[] { _sc, _slcs };
|
||||
|
||||
protected static final String[] _pre_sm_1_3 = new String[] { _sm_1_2, _sm_1_1, _sm_1_0 };
|
||||
protected static final String[] _pre_sm_1_4 = concat(_sm_1_3, _pre_sm_1_3);
|
||||
protected static final String[] _pre_sm_1_5 = concat(_sm_1_4, _pre_sm_1_4);
|
||||
protected static final String[] _pre_sm_1_6 = concat(_sm_1_5, _pre_sm_1_5);
|
||||
protected static final String[] _pre_sm_1_7 = concat(_sm_1_6, _pre_sm_1_6);
|
||||
protected static final String[] _pre_sm_1_8 = concat(_sm_1_7, _pre_sm_1_7);
|
||||
protected static final String[] _pre_sm_1_9 = concat(_sm_1_8, _pre_sm_1_8);
|
||||
protected static final String[] _pre_sm_1_10 = concat(_sm_1_9, _pre_sm_1_9);
|
||||
protected static final String[] _pre_sm_1_11 = concat(_sm_1_10, _pre_sm_1_10);
|
||||
protected static final String[] _pre_sm_2_0 = concat(_sm_1_11, _pre_sm_1_11);
|
||||
protected static final String[] _pre_sm_2_1 = concat(_sm_2_0, _pre_sm_2_0);
|
||||
protected static final String[] _pre_sm_2_2 = concat(_sm_2_1, _pre_sm_2_1);
|
||||
protected static final String[] _pre_sm_2_3 = concat(_sm_2_2, _pre_sm_2_2);
|
||||
protected static final String[] _pre_sm_2_4 = concat(_sm_2_3, _pre_sm_2_3);
|
||||
protected static final String[] _pre_sm_2_5 = concat(_sm_2_4, _pre_sm_2_4);
|
||||
protected static final String[] _pre_sm_2_6 = concat(_sm_2_5, _pre_sm_2_5);
|
||||
protected static final String[] _pre_sm_3_0 = concat(_sm_2_6, _pre_sm_2_6);
|
||||
protected static final String[] _pre_sm_3_1 = concat(_sm_3_0, _pre_sm_3_0);
|
||||
protected static final String[] _pre_sm_3_2 = concat(_sm_3_1, _pre_sm_3_1);
|
||||
|
||||
private static final String[] _pre_sm_1_7_post_1_4 = new String[] { _sm_1_6, _sm_1_5 };
|
||||
private static final String[] _pre_sm_1_7_post_1_0 = new String[] { _sm_1_6, _sm_1_5, _sm_1_4, _sm_1_3, _sm_1_2, _sm_1_1 };
|
||||
|
||||
public static final String[] _all = concat(_all_sm, _all_old);
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _speedFactor = PositiveFactor("move.speed.factor").defaults(1F).comment("Global player speed factor (>= 0)").book("Global Speed", "Below you find the options to manipulate the global speed applied to all speeds.");
|
||||
public final Property<Boolean> _speedUser = Creative("move.speed.user").defaults(true, _pre_sm_3_2).comment("To switch on/off in-game speed manipulation");
|
||||
public final Property<Float> _speedUserFactor = PositiveFactor("move.speed.user.factor").singular().defaults(0.2F).min(0.0001F).comment("The factor for in-game speed manipulation (>= 0.0001)");
|
||||
public final Property<Integer> _speedUserExponent = Integer("move.speed.user.exponent").singular().defaults(0).comment("The exponent for in-game speed manipulation");
|
||||
|
||||
|
||||
|
||||
public final Property<String> _baseClimb = String().defaults("free").key("move.climb.base") .key("move.climb.ladder", _pre_sm_1_10).key("climbing.ladder", _all_old).comment("To manipulate the ladder and vine climbing mode (possible values are \"free\", \"smart\", \"simple\" and \"standard\")").book("Climbing", "Below you find all free and ladder climbing options except those for ceiling climbing.");
|
||||
public final Property<Boolean> _freeClimb = Unmodified().key("move.climb.free").key("climbing.free", _all_old).comment("To switch on/off free climbing");
|
||||
public final Property<Boolean> _freeBaseLadderClimb = Modified().key("move.climb.free.base.ladder").comment("To switch on/off remaining base climbing behavior on ladders while free climbing is enabled for ladders (also see \"move.climb.base\")");
|
||||
public final Property<Boolean> _freeBaseVineClimb = Modified().key("move.climb.free.base.vine").defaults(true, _pre_sm_1_11).comment("To switch on/off remaining base climbing behavior on vines while free climbing is enabled for vines (also see \"move.climb.base\")");
|
||||
|
||||
public final Property<Boolean> _isFreeBaseClimb = _baseClimb.is("free").and(_freeClimb);
|
||||
public final Property<Boolean> _isSmartBaseClimb = _baseClimb.is("smart").andNot(_isFreeBaseClimb);
|
||||
public final Property<Boolean> _isSimpleBaseClimb = _baseClimb.is("simple").andNot(_isFreeBaseClimb).andNot(_isSmartBaseClimb);
|
||||
public final Property<Boolean> _isStandardBaseClimb = _isFreeBaseClimb.not().andNot(_isSmartBaseClimb).andNot(_isSimpleBaseClimb);
|
||||
|
||||
|
||||
public final Property<Float> _freeClimbingUpSpeedFactor = PositiveFactor("move.climb.free.up.speed.factor").comment("Climbing up speed factor relative to default climbing up speed (>= 0)").chapter();
|
||||
public final Property<Float> _freeClimbingDownSpeedFactor = PositiveFactor("move.climb.free.down.speed.factor").comment("Climbing down speed factor relative to default climbing down speed (>= 0)");
|
||||
public final Property<Float> _freeClimbingHorizontalSpeedFactor = PositiveFactor("move.climb.free.horizontal.speed.factor").comment("Climbing horizontal speed factor relative to default climbing horizontal speed (>= 0)");
|
||||
public final Property<Float> _freeClimbingOrthogonalDirectionAngle = Positive("move.climb.free.direction.orthogonal.angle").values(90F, 90F, 180F).comment("Climbing N,S,E,W grabbing angle in degrees");
|
||||
public final Property<Float> _freeClimbingDiagonalDirectionAngle = Positive("move.climb.free.direction.diagonal.angle").values(80F, 45F, 180F).comment("Climbing NW,SW,SE,NE grabbing angle in degrees");
|
||||
|
||||
public final Property<Boolean> _freeClimbingAutoLaddder = Unmodified("move.climb.free.ladder.auto").depends(_isFreeBaseClimb).comment("Whether the \"grab\" button will automatically be triggered while being on ladders and looking in the right direction").section();
|
||||
public final Property<Boolean> _freeClimbingAutoVine = Unmodified("move.climb.free.vine.auto").depends(_isFreeBaseClimb).comment("Whether the \"grab\" button will automatically be triggered while being on standard climbable vines and looking in the right direction");
|
||||
public final Property<Float> _freeOneLadderClimbUpSpeedFactor = PositiveFactor("move.climb.free.ladder.one.up.speed.factor").defaults(1.0153F).defaults(0.71F, _pre_sm_2_4).comment("Additional speed factor when climbing straight up on one ladder block (>= 0)");
|
||||
public final Property<Float> _freeBothLadderClimbUpSpeedFactor = IncreasingFactor("move.climb.free.ladder.two.up.speed.factor").defaults(1.43F).comment("Additional speed factor when climbing straight up on two ladder blocks (>= 1)");
|
||||
public final Property<Boolean> _freeFenceClimbing = Unmodified("move.climb.free.fence").comment("Climbing over fences");
|
||||
|
||||
public final Property<Float> _freeClimbFallDamageStartDistance = Positive("move.climb.fall.damage.start.distance").values(2F, 1F, 3F).comment("Distance in blocks to fall before suffering fall damage when starting to climb (>= 1, <= 3)").section();
|
||||
public final Property<Float> _freeClimbFallDamageFactor = IncreasingFactor("move.climb.fall.damage.factor").defaults(2F).comment("Damage factor applied to the remaining distance (>= 1)");
|
||||
public final Property<Float> _freeClimbFallMaximumDistance = Positive("move.climb.fall.maximum.distance").defaults(3F).min(_freeClimbFallDamageStartDistance).comment("Distance in blocks to fall to block all climbing attempts (>= \"move.climb.fall.damage.start.distance\")");
|
||||
|
||||
public final Property<Boolean> _climbExhaustion = Hard("move.climb.exhaustion").comment("To switch on/off exhaustion while climbing").section();
|
||||
public final Property<Float> _climbExhaustionStart = Positive("move.climb.exhaustion.start").defaults(60F).defaults(0F, _pre_sm_1_4).comment("Maximum exhaustion to start climbing along ceilings (>= 0)");
|
||||
public final Property<Float> _climbExhaustionStop = Positive("move.climb.exhaustion.stop").up(80F, _climbExhaustionStart).defaults(100F, _pre_sm_1_4).comment("Maximum exhaustion to climb (>= 0)");
|
||||
public final Property<Float> _climbStrafeExhaustionGain = Positive("move.climb.strafe.exhaustion.gain").defaults(1.1F).defaults(0.75F, _pre_sm_1_4).comment("Exhaustion added every tick while climbing horizontally (>= 0)");
|
||||
public final Property<Float> _climbUpExhaustionGain = Positive("move.climb.up.exhaustion.gain").defaults(1.2F).defaults(1F, _pre_sm_1_4).comment("Exhaustion added every tick while climbing up (>= 0)");
|
||||
public final Property<Float> _climbDownExhaustionGain = Positive("move.climb.down.exhaustion.gain").defaults(1.05F).defaults(0.5F, _pre_sm_1_4).comment("Exhaustion added every tick while climbing down (>= 0)");
|
||||
public final Property<Float> _climbStrafeUpExhaustionGain = Positive("move.climb.strafe.up.exhaustion.gain").defaults(1.3F).comment("Exhaustion added every tick while climbing diagonally up (>= 0)");
|
||||
public final Property<Float> _climbStrafeDownExhaustionGain = Positive("move.climb.strafe.down.exhaustion.gain").defaults(1.25F).comment("Exhaustion added every tick while climbing diagonally down (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _ceilingClimbing = Unmodified("move.climb.ceiling").comment("To switch on/off climbing along ceilings").book("Ceiling climbing", "Below you find all ceiling climbing options");
|
||||
public final Property<Float> _ceilingClimbingSpeedFactor = PositiveFactor("move.climb.ceiling.speed.factor").defaults(0.2F).comment("Speed factor while climbing along ceilings (>= 0, relative to default movement speed)");
|
||||
public final Property<String[]> _ceilingClimbConfigurationString = Strings("move.climb.ceiling.configuration").defaults(new String[] { "tile.fenceIron", "tile.trapdoor/0/1/2/3", "tile.trapdoor_iron/0/1/2/3" }).defaults(new String[] { "tile.fenceIron", "tile.trapdoor/0/1/2/3" }, _pre_sm_2_5).comment("To define which blocks are ceiling climbable (syntax: '<blockId/blockName>(/<metadata>)*' seperator: ',')");
|
||||
public final Property<Dictionary<Object, Set<Integer>>> _ceilingClimbConfigurationObject = _ceilingClimbConfigurationString.toBlockConfig();
|
||||
|
||||
public final Property<Boolean> _ceilingClimbExhaustion = Hard("move.climb.ceiling.exhaustion").comment("To switch on/off exhaustion while climbing along ceilings").section();
|
||||
public final Property<Float> _ceilingClimbExhaustionStart = Positive("move.climb.ceiling.exhaustion.start").defaults(40F).defaults(0F, _pre_sm_1_4).comment("Maximum exhaustion to start climbing along ceilings (>= 0)");
|
||||
public final Property<Float> _ceilingClimbExhaustionStop = Positive("move.climb.ceiling.exhaustion.stop").up(60F, _ceilingClimbExhaustionStart).defaults(100F, _pre_sm_1_4).comment("Maximum exhaustion to climbing along ceilings (>= \"move.climb.ceiling.exhaustion.start\")");
|
||||
public final Property<Float> _ceilingClimbExhaustionGain = Positive("move.climb.ceiling.exhaustion.gain").defaults(1.3F).defaults(2F, _pre_sm_1_4).comment("Exhaustion added every tick while climbing along ceilings (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _swim = Unmodified().key("move.swim").key("climbing.swim", _all_old).comment("To switch on/off swimming").book("Swimming", "Below you find all swimming options");
|
||||
public final Property<Float> _swimSpeedFactor = PositiveFactor("move.swim.speed.factor").comment("Speed factor while swimming (>= 0, relative to default movement speed)");
|
||||
public final Property<Boolean> _swimDownOnSneak = Unmodified().key("move.swim.down.sneak").defaults(false, _pre_sm_1_6).comment("To switch on/off diving down instead of swimming slow on sneaking while swimming");
|
||||
public final Property<Float> _swimParticlePeriodFactor = PositiveFactor("move.swim.particle.period.factor").comment("Swim particle spawning period factor (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _dive = Unmodified().key("move.dive").key("climbing.dive", _all_old).comment("To switch on/off diving").book("Diving", "Below you find all diving options");
|
||||
public final Property<Float> _diveSpeedFactor = PositiveFactor("move.dive.speed.factor").comment("Speed factor while diving (>= 0, relative to default movement speed)");
|
||||
public final Property<Boolean> _diveDownOnSneak = Unmodified().key("move.dive.down.sneak").defaults(false, _pre_sm_1_6).comment("To switch on/off diving down instead of diving slow on sneaking while diving");
|
||||
|
||||
|
||||
public final Property<Boolean> _lavaLikeWater = Creative("move.lava.water").comment("To switch on/off swimming and diving in lava").book("Lava", "Below you find all lava movement options");
|
||||
public final Property<Float> _lavaSwimParticlePeriodFactor = PositiveFactor("move.lava.swim.particle.period.factor").defaults(4F).comment("Lava swim particle spawning period factor (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _run = Unmodified("move.run").comment("To switch on/off standard sprinting").book("Standard sprinting", "Below you find the options for standard vanilla Minecraft sprinting (sometimes referred as \"running\" here)");
|
||||
public final Property<Float> _runFactor = PositiveFactor("move.run.factor").defaults(1.3F).min(1.1F).comment("Standard sprinting factor (>= 1.1)");
|
||||
public final Property<Boolean> _runExhaustion = Hard("move.run.exhaustion").depends(_run).comment("To switch on/off standard sprinting exhaustion");
|
||||
|
||||
public final Property<Float> _runExhaustionStart = Positive("move.exhaustion.run.start").defaults(75F).comment("Maximum exhaustion to start a standard sprint (>= 0)").section();
|
||||
public final Property<Float> _runExhaustionStop = Positive("move.exhaustion.run.stop").up(100F, _runExhaustionStart).comment("Maximum exhaustion to continue a standard sprint (>= \"move.exhaustion.run.start\")");
|
||||
public final Property<Float> _runExhaustionGainFactor = Positive("move.exhaustion.run.gain.factor").defaults(1.5F).comment("Exhaustion gain factor while standard sprinting (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _sprint = Unmodified("move.sprint").comment("To switch on/off generic sprinting").book("Generic sprinting", "Below you find the options for Smart Moving's generic sprinting available for many different smart movings plus standard walking");
|
||||
public final Property<Float> _sprintFactor = PositiveFactor("move.sprint.factor").defaults(1.5F).min(_run.eitherOr(_runFactor.plus(0.1F), 1.1F)).comment("Generic sprinting factor (>= 1.1 AND >= 'move.run.factor' + 0.1 if relevant)");
|
||||
public final Property<Boolean> _sprintExhaustion = Medium("move.sprint.exhaustion").depends(_sprint).comment("To switch on/off sprinting exhaustion");
|
||||
|
||||
public final Property<Float> _sprintExhaustionStart = Positive("move.exhaustion.sprint.start").defaults(50F).comment("Maximum exhaustion to start a sprint (>= 0)").section();
|
||||
public final Property<Float> _sprintExhaustionStop = Positive("move.exhaustion.sprint.stop").up(100F, _sprintExhaustionStart).comment("Maximum exhaustion to continue a sprint (>= \"move.exhaustion.sprint.start\")");
|
||||
public final Property<Float> _sprintExhaustionGainFactor = IncreasingFactor("move.exhaustion.sprint.gain.factor").defaults(2F).comment("Exhaustion gain factor while sprinting (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _sneak = Unmodified("move.sneak").comment("To switch on/off standard sneaking").book("Generic sneaking", "Below you find the options for Smart Moving's generic sneaking available for many different smart movings. These options also apply to standard sneaking!");
|
||||
public final Property<Float> _sneakFactor = DecreasingFactor("move.sneak.factor").defaults(0.3F).comment("Speed factor while sneaking (>= 0, <= 1, relative to default movement speed)");
|
||||
public final Property<Boolean> _sneakNameTag = Modified("move.sneak.name").comment("Whether to display a name tag above other standard sneaking players");
|
||||
|
||||
|
||||
public final Property<Boolean> _crawl = Unmodified("move.crawl").comment("To switch on/off crawling").book("Crawling", "Below you find all crawling options.");
|
||||
public final Property<Float> _crawlFactor = DecreasingFactor("move.crawl.factor").defaults(0.15F).comment("Speed factor while crawling (>= 0, <= 1, relative to default movement speed)");
|
||||
public final Property<Boolean> _crawlNameTag = Modified("move.crawl.name").comment("Whether to display a name tag above other crawling players");
|
||||
public final Property<Boolean> _crawlOverEdge = Unmodified("move.crawl.edge").comment("Whether to allow crawling over edges");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _slide = Unmodified("move.slide").comment("To switch on/off sliding").book("Sliding", "Below you find all sliding options.");
|
||||
public final Property<Float> _slideControlDegrees = PositiveFactor("move.slide.control.angle").defaults(1F).comment("Sliding control movement factor (>= 0, in degrees per tick)");
|
||||
public final Property<Float> _slideSlipperinessFactor = PositiveFactor("move.slide.glide.factor").comment("Slipperiness factor while sliding (>= 0)");
|
||||
public final Property<Float> _slidingSpeedStopFactor = PositiveFactor("move.slide.speed.stop.factor").comment("Sliding to crawling transition speed factor (>= 0)");
|
||||
public final Property<Float> _slideParticlePeriodFactor = PositiveFactor("move.slide.particle.period.factor").defaults(0.5F).defaults(1F, _pre_sm_1_6).comment("Sliding particle spawning period factor (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _fly = Unmodified("move.fly").comment("To switch on/off smart flying").book("Smart flying", "Below you find all options for Smart Moving's own flying mode.");
|
||||
public final Property<Float> _flyingSpeedFactor = PositiveFactor("move.fly.speed.factor").comment("To manipulate smart flying speed (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _levitateSmall = Unmodified("move.levitate.small").comment("To switch on/off standard flying small size").book("Standard flying", "Below you find the options for standard vanilla Minecraft flying (sometimes referred as \"levitating\" here)");
|
||||
public final Property<Boolean> _levitateAnimation = Unmodified("move.levitate.animation").key("move.fly.animation").comment("To switch on/off standard flying animation");
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _fallingDistanceMinimum = Positive("move.fall.distance.minimum").defaults(3F).comment("Minimum fall distance for stopping ground based moves like crawling or sliding (>= 0)").book("Falling", "Below you find the options for Smart Moving's falling");
|
||||
public final Property<Boolean> _fallAnimation = Unmodified("move.fall.animation").comment("To switch on/off smart falling animation");
|
||||
public final Property<Float> _fallAnimationDistanceMinimum = Positive("move.fall.animation.distance.minimum").min(_fallingDistanceMinimum).defaults(3F, _pre_sm_1_6).comment("Minimum fall distance for the smart falling animation (>= 0, >= \"move.fall.animation.distance.minimum\"");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _jump = Unmodified("move.jump").comment("To switch on/off jumping").book("Jumping", "Below you find the options for all Smart Moving's different jump types. These options also apply to standard jumping!");
|
||||
public final Property<Float> _jumpControlFactor = DecreasingFactor("move.jump.control.factor").defaults(1F).comment("Jumping control movement factor (>= 0, <= 1, relative to default air movement speed)");
|
||||
|
||||
public final Property<Float> _jumpHorizontalFactor = IncreasingFactor("move.jump.horizontal.factor").comment("Horizontal jumping factor relative to actual horizontal movement (>= 1)").section();
|
||||
public final Property<Float> _jumpVerticalFactor = PositiveFactor("move.jump.vertical.factor").comment("Vertical jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _standJump = Unmodified("move.jump.stand").depends(_jump).comment("To switch on/off jumping while standing (Relevant only if \"move.jump\" is true)").chapter();
|
||||
public final Property<Float> _standJumpVerticalFactor = PositiveFactor("move.jump.stand.vertical.factor").comment("Vertical stand jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
public final Property<Boolean> _sneakJump = Unmodified("move.jump.sneak").key("move.sneak.jump", _pre_sm_1_7).depends(_sneak, _jump).comment("To switch on/off jumping while sneaking (Relevant only if nether \"move.sneak\" nor \"move.jump\" are false)").chapter();
|
||||
public final Property<Float> _sneakJumpHorizontalFactor = IncreasingFactor("move.jump.sneak.horizontal.factor").key("move.sneak.jump.horizontal.factor", _pre_sm_1_7).comment("Horizontal sneak jumping factor relative to actual horizontal movement (>= 1)");
|
||||
public final Property<Float> _sneakJumpVerticalFactor = PositiveFactor("move.jump.sneak.vertical.factor").key("move.sneak.jump.vertical.factor", _pre_sm_1_7).comment("Vertical sneak jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
public final Property<Boolean> _walkJump = Unmodified("move.jump.walk").depends(_jump).comment("To switch on/off jumping while walking (Relevant only if \"move.jump\" is true)").chapter();
|
||||
public final Property<Float> _walkJumpHorizontalFactor = IncreasingFactor("move.jump.walk.horizontal.factor").comment("Horizontal walk jumping factor relative to actual horizontal movement (>= 1)");
|
||||
public final Property<Float> _walkJumpVerticalFactor = PositiveFactor("move.jump.walk.vertical.factor").comment("Vertical walk jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
public final Property<Boolean> _runJump = Unmodified("move.jump.run").key("move.run.jump", _pre_sm_1_7).depends(_run, _jump).comment("To switch on/off jumping while running (Relevant only if nether \"move.run\" nor \"move.jump\" are false)").chapter();
|
||||
public final Property<Float> _runJumpHorizontalFactor = IncreasingFactor("move.jump.run.horizontal.factor").key("move.run.jump.horizontal.factor", _pre_sm_1_7).defaults(2F).comment("Horizontal run jumping factor relative to actual horizontal movement (>= 1)");
|
||||
public final Property<Float> _runJumpVerticalFactor = PositiveFactor("move.jump.run.vertical.factor").key("move.run.jump.vertical.factor", _pre_sm_1_7).comment("Vertical run jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
public final Property<Boolean> _sprintJump = Unmodified("move.jump.sprint").key("move.sprint.jump", _pre_sm_1_7).depends(_sprint, _jump).comment("To switch on/off jumping while sprinting (Relevant only if nether \"move.sprint\" nor \"move.jump\" are false)").chapter();
|
||||
public final Property<Float> _sprintJumpHorizontalFactor = IncreasingFactor("move.jump.sprint.horizontal.factor").key("move.sprint.jump.horizontal.factor", _pre_sm_1_7).defaults(2F).comment("Horizontal sprint jumping factor relative to actual horizontal movement (>= 1)");
|
||||
public final Property<Float> _sprintJumpVerticalFactor = PositiveFactor("move.jump.sprint.vertical.factor").key("move.sprint.jump.vertical.factor", _pre_sm_1_7).comment("Vertical sprint jumping factor relative to default jump height (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _jumpCharge = Unmodified("move.jump.charge").depends(_jump).comment("Relevant only if \"move.jump\" is not false").chapter("Charged jumping", "Below you find all charged jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _jumpChargeMaximum = Positive("move.jump.charge.maximum").defaults(20F).comment("Maximum jump charge (counts up one per tick) (>= 0)");
|
||||
public final Property<Float> _jumpChargeFactor = IncreasingFactor("move.jump.charge.factor").defaults(1.3F).comment("Jump speed factor when completely charged (>= 1)");
|
||||
public final Property<Boolean> _jumpChargeCancelOnSneakRelease = Modified("move.jump.charge.sneak.release.cancel").comment("To switch between charged jump and charge cancel on sneak button release while jump charging");
|
||||
|
||||
|
||||
public final Property<Boolean> _headJump = Unmodified("move.jump.head.charge").key("move.forward.jump.charge", _pre_sm_1_8) .depends(_jump).comment("Relevant only if \"move.jump\" is not false").chapter("Head jumping", "Below you find all head jump and fall specific options except those for exhaustion.");
|
||||
public final Property<Float> _headJumpControlFactor = DecreasingFactor("move.jump.head.control.factor").key("move.forward.jump.control.factor", _pre_sm_1_8).defaults(0.2F).comment("Head jump control movement factor (>= 0, <= 1, relative to default air movement speed)");
|
||||
public final Property<Float> _headJumpChargeMaximum = Positive("move.jump.head.charge.maximum").key("move.forward.jump.charge.maximum", _pre_sm_1_8).defaults(10F).comment("Maximum head jump charge (counts up one per tick) (>= 0)");
|
||||
|
||||
public final Property<Float> _headFallDamageStartDistance = Positive("move.fall.head.damage.start.distance").key("move.forward.fall.damage.start.distance", _pre_sm_1_8).values(2F, 1F, 3F).comment("Distance in blocks to fall head ahead before suffering fall damage (>= 1, <= 3)").section();
|
||||
public final Property<Float> _headFallDamageFactor = IncreasingFactor("move.fall.head.damage.factor").key("move.forward.fall.damage.factor", _pre_sm_1_8).defaults(2F).comment("Damage factor applied to the remaining distance when impacting head ahead (>= 1)");
|
||||
|
||||
|
||||
public final Property<Boolean> _angleJumpSide = Unmodified("move.jump.angle.side").comment("To switch on/off side jumping").chapter("Side and Back jumping", "Below you find all side and back jump specific options except those for exhaustion.");
|
||||
public final Property<Boolean> _angleJumpBack = Unmodified("move.jump.angle.back").comment("To switch on/off back jumping");
|
||||
public final Property<Float> _angleJumpHorizontalFactor = PositiveFactor("move.jump.angle.horizontal.factor").defaults(0.3F).defaults(0.4F, _sm_1_3).comment("Horizontal jump speed factor for side and back jumps (>= 0)");
|
||||
public final Property<Float> _angleJumpVerticalFactor = PositiveFactor("move.jump.angle.vertical.factor").defaults(0.2F).comment("Vertical jump speed factor for side and back jumps (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _climbUpJump = Unmodified("move.jump.climb.up").comment("To switch on/off jumping up while climbing").chapter("Climb jumping", "Below you find all climb up jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _climbUpJumpVerticalFactor = DecreasingFactor("move.jump.climb.up.vertical.factor").comment("Vertical jump speed factor for jumping while climbing (>= 0, <= 1)");
|
||||
public final Property<Float> _climbUpJumpHandsOnlyVerticalFactor = DecreasingFactor("move.jump.climb.up.hands.only.vertical.factor").defaults(0.8F).comment("Additional vertical jump speed factor for jumping while climbing with hands only (>= 0, <= 1)");
|
||||
|
||||
|
||||
public final Property<Boolean> _climbBackUpJump = Unmodified("move.jump.climb.back.up").comment("To switch on/off jumping back while climbing").chapter("Climb back jumping", "Below you find all climb back jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _climbBackUpJumpVerticalFactor = DecreasingFactor("move.jump.climb.back.up.vertical.factor").defaults(0.2F).defaults(1F, _pre_sm_3_1).comment("Vertical jump speed factor for jumping back while climbing (>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackUpJumpHorizontalFactor = DecreasingFactor("move.jump.climb.back.up.horizontal.factor").defaults(0.3F).defaults(1F, _pre_sm_3_1).comment("Horizontal jump speed factor for jumping back while climbing (>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackUpJumpHandsOnlyVerticalFactor = DecreasingFactor("move.jump.climb.back.up.hands.only.vertical.factor").defaults(0.8F).comment("Additional vertical jump speed factor for jumping back while climbing with hands only (>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackUpJumpHandsOnlyHorizontalFactor = DecreasingFactor("move.jump.climb.back.up.hands.only.horizontal.factor").comment("Additional horizontal jump speed factor for jumping back while climbing with hands only (>= 0, <= 1)");
|
||||
|
||||
|
||||
public final Property<Boolean> _climbBackHeadJump = Unmodified("move.jump.climb.back.head").comment("To switch on/off head jumping back while climbing").chapter("Climb back head jumping", "Below you find all climb back head jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _climbBackHeadJumpVerticalFactor = DecreasingFactor("move.jump.climb.back.head.vertical.factor").defaults(0.2F).defaults(1F, _pre_sm_3_1).comment("Additional vertical jump speed factor for head jumping back while climbing(>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackHeadJumpHorizontalFactor = DecreasingFactor("move.jump.climb.back.head.horizontal.factor").defaults(0.3F).defaults(1F, _pre_sm_3_1).comment("Additional horizontal jump speed factor for head jumping back while climbing(>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackHeadJumpHandsOnlyVerticalFactor = DecreasingFactor("move.jump.climb.back.head.hands.only.vertical.factor").defaults(0.8F).comment("Additional vertical jump speed factor for head jumping while climbing with hands only (>= 0, <= 1)");
|
||||
public final Property<Float> _climbBackHeadJumpHandsOnlyHorizontalFactor = DecreasingFactor("move.jump.climb.back.head.hands.only.horizontal.factor").comment("Additional horizontal jump speed factor for head jumping while climbing with hands only (>= 0, <= 1)");
|
||||
|
||||
|
||||
public final Property<Boolean> _wallUpJump = Unmodified("move.jump.wall").comment("To switch on/off wall jumping").chapter("Wall jumping", "Below you find all wall jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _wallUpJumpVerticalFactor = DecreasingFactor("move.jump.wall.vertical.factor").defaults(0.4F).comment("Vertical jump speed factor for wall jumping (>= 0, <= 1)");
|
||||
public final Property<Float> _wallUpJumpHorizontalFactor = DecreasingFactor("move.jump.wall.horizontal.factor").defaults(0.15F).comment("Horizontal jump speed factor for wall jumping (>= 0, <= 1)");
|
||||
public final Property<Float> _wallUpJumpFallMaximumDistance = Positive("move.jump.wall.fall.maximum.distance").defaults(2F).comment("Distance in blocks to fall to block all wall jumping attempts");
|
||||
public final Property<Float> _wallUpJumpOrthogonalTolerance = Positive("move.jump.wall.orthogonal.tolerance").defaults(5F).comment("Tolerance angle in degree for wall jumping orthogonally (>= 0, <= 45)");
|
||||
|
||||
|
||||
public final Property<Boolean> _wallHeadJump = Unmodified("move.jump.wall.head").comment("To switch on/off wall head jumping").chapter("Wall head jumping", "Below you find all wall head jump specific options except those for exhaustion.");
|
||||
public final Property<Float> _wallHeadJumpVerticalFactor = DecreasingFactor("move.jump.wall.head.vertical.factor").defaults(0.3F).comment("Vertical jump speed factor for wall head jumping (>= 0, <= 1)");
|
||||
public final Property<Float> _wallHeadJumpHorizontalFactor = DecreasingFactor("move.jump.wall.head.horizontal.factor").defaults(0.15F).comment("Horizontal jump speed factor for wall head jumping (>= 0, <= 1)");
|
||||
public final Property<Float> _wallHeadJumpFallMaximumDistance = Positive("move.jump.wall.head.fall.maximum.distance").defaults(3F).min(_wallUpJumpFallMaximumDistance).comment("Distance in blocks to fall to block all wall head jumping attempts (>= \"move.jump.wall.fall.maximum.distance\")");
|
||||
|
||||
|
||||
private final Property<Boolean> _old_jumpExhaustion = Hard("move.jump.exhaustion", _pre_sm_1_7);
|
||||
private final Property<Float> _old_jumpExhaustionGain = Positive("move.jump.exhaustion.gain", _pre_sm_1_7_post_1_0).key("move.exhaustion.jump.gain", _sm_1_0).defaults(40F).defaults(10F, _pre_sm_1_4);
|
||||
private final Property<Float> _old_jumpExhaustionStop = Positive("move.jump.exhaustion.stop", _pre_sm_1_7_post_1_0).key("move.exhaustion.jump.stop", _sm_1_0).defaults(60F).defaults(100F, _pre_sm_1_4);
|
||||
|
||||
private final Property<Boolean> _old_sneakJumpExhaustion = Hard("move.jump.sneak.exhaustion", _pre_sm_1_7_post_1_4).key("move.sneak.jump.exhaustion", _pre_sm_1_4);
|
||||
private final Property<Float> _old_sneakJumpExhaustionGain = Positive("move.sneak.jump.exhaustion.gain", _pre_sm_1_7).down(45F, _old_jumpExhaustionGain).defaults(10F, _pre_sm_1_4);
|
||||
private final Property<Float> _old_sneakJumpExhaustionStop = Positive("move.sneak.jump.exhaustion.stop", _pre_sm_1_7).up(55F, _old_jumpExhaustionStop).defaults(100F, _pre_sm_1_4);
|
||||
|
||||
private final Property<Boolean> _old_runJumpExhaustion = Medium("move.jump.run.exhaustion", _pre_sm_1_7_post_1_4).key("move.run.jump.exhaustion", _pre_sm_1_4);
|
||||
private final Property<Float> _old_runJumpExhaustionGain = Positive("move.run.jump.exhaustion.gain", _pre_sm_1_7).defaults(60F).defaults(20F, _pre_sm_1_4);
|
||||
private final Property<Float> _old_runJumpExhaustionStop = Positive("move.run.jump.exhaustion.stop", _pre_sm_1_7).defaults(40F).defaults(100F, _pre_sm_1_4);
|
||||
|
||||
private final Property<Boolean> _old_sprintJumpExhaustion = Medium("move.jump.sprint.exhaustion", _pre_sm_1_7_post_1_4).key("move.sprint.jump.exhaustion", _pre_sm_1_4);
|
||||
private final Property<Float> _old_sprintJumpExhaustionGain = Positive("move.sprint.jump.exhaustion.gain", _pre_sm_1_7_post_1_0).key("move.exhaustion.sprint.jump.gain", _sm_1_0).up(65F, _old_runJumpExhaustionGain).defaults(20F, _pre_sm_1_4);
|
||||
private final Property<Float> _old_sprintJumpExhaustionStop = Positive("move.sprint.jump.exhaustion.stop", _pre_sm_1_7_post_1_0).key("move.exhaustion.sprint.jump.stop", _sm_1_0).down(35F, _old_runJumpExhaustionStop).defaults(100F, _pre_sm_1_4);
|
||||
|
||||
|
||||
public final Property<Boolean> _jumpExhaustion = Unmodified("move.jump.exhaustion").comment("To switch on/off jump exhaustion").chapter("Jump exhaustion", "Below you find the exhaustion options for the different jump types. At runtime all relevant options are combined together to form the specific exhaustion value");
|
||||
public final Property<Float> _jumpExhaustionGainFactor = PositiveFactor("move.jump.exhaustion.gain.factor").comment("To manipulate the exhaustion increase by a jump (>= 0)");
|
||||
public final Property<Float> _jumpExhaustionStopFactor = PositiveFactor("move.jump.exhaustion.stop.factor").comment("To manipulate maximum exhaustion to jump (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _upJumpExhaustion = Unmodified("move.jump.up.exhaustion").depends(_jumpExhaustion).comment("To switch on/off up jump exhaustion").chapter();
|
||||
public final Property<Float> _upJumpExhaustionGainFactor = PositiveFactor("move.jump.up.exhaustion.gain.factor").comment("To manipulate the exhaustion increase by a jump up (>= 0)");
|
||||
public final Property<Float> _upJumpExhaustionStopFactor = PositiveFactor("move.jump.up.exhaustion.stop.factor").comment("To manipulate maximum exhaustion to jump up (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _climbJumpExhaustion = Hard("move.jump.climb.exhaustion").depends(_jumpExhaustion).comment("To switch on/off climb jump exhaustion").chapter();
|
||||
public final Property<Float> _climbJumpExhaustionGainFactor = PositiveFactor("move.climb.jump.exhaustion.gain.factor").comment("To manipulate the exhaustion increase by jumping while climbing (>= 0)");
|
||||
public final Property<Float> _climbJumpExhaustionStopFactor = PositiveFactor("move.climb.jump.exhaustion.stop.factor").comment("To manipulate maximum exhaustion to jumping while climbing (>= 0)");
|
||||
|
||||
public final Property<Boolean> _climbJumpUpExhaustion = Unmodified("move.jump.climb.up.exhaustion").depends(_climbJumpExhaustion).comment("To switch on/off climb up jump exhaustion").section();
|
||||
public final Property<Float> _climbJumpUpExhaustionGainFactor = PositiveFactor("move.jump.climb.up.exhaustion.gain.factor").defaults(40F).defaults(1F, _pre_sm_3_1).comment("To manipulate the exhaustion increase by a jump up while climbing (>= 0)");
|
||||
public final Property<Float> _climbJumpUpExhaustionStopFactor = PositiveFactor("move.jump.climb.up.exhaustion.stop.factor").defaults(60F).defaults(1F, _pre_sm_3_1).comment("To manipulate maximum exhaustion to jump up while climbing (>= 0)");
|
||||
|
||||
public final Property<Boolean> _climbJumpBackUpExhaustion = Unmodified("move.jump.climb.back.up.exhaustion").depends(_climbJumpExhaustion).comment("To switch on/off climb back jump exhaustion").section();
|
||||
public final Property<Float> _climbJumpBackUpExhaustionGainFactor = PositiveFactor("move.jump.climb.back.up.exhaustion.gain.factor").defaults(40F).defaults(1F, _pre_sm_3_1).comment("To manipulate the exhaustion increase by a jump back while climbing (>= 0)");
|
||||
public final Property<Float> _climbJumpBackUpExhaustionStopFactor = PositiveFactor("move.jump.climb.back.up.exhaustion.stop.factor").defaults(60F).defaults(1F, _pre_sm_3_1).comment("To manipulate maximum exhaustion to jump back while climbing (>= 0)");
|
||||
|
||||
public final Property<Boolean> _climbJumpBackHeadExhaustion = Unmodified("move.jump.climb.back.head.exhaustion").depends(_climbJumpExhaustion).comment("To switch on/off back climb head jump exhaustion").section();
|
||||
public final Property<Float> _climbJumpBackHeadExhaustionGainFactor = PositiveFactor("move.jump.climb.back.head.exhaustion.gain.factor").defaults(20F).defaults(1F, _pre_sm_3_1).comment("To manipulate the exhaustion increase by a head jump back while climbing (>= 0)");
|
||||
public final Property<Float> _climbJumpBackHeadExhaustionStopFactor = PositiveFactor("move.jump.climb.back.head.exhaustion.stop.factor").defaults(80F).defaults(1F, _pre_sm_3_1).comment("To manipulate maximum exhaustion to head jump back while climbing (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _angleJumpExhaustion = Unmodified("move.jump.angle.exhaustion").depends(_jumpExhaustion).comment("To switch on/off angle jump exhaustion").chapter();
|
||||
public final Property<Float> _angleJumpExhaustionGainFactor = PositiveFactor("move.jump.angle.exhaustion.gain.factor").comment("To manipulate the exhaustion increase by a jump to the side or back (>= 0)");
|
||||
public final Property<Float> _angleJumpExhaustionStopFactor = PositiveFactor("move.jump.angle.exhaustion.stop.factor").comment("To manipulate maximum exhaustion to jump to the side or back (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _wallJumpExhaustion = Medium("move.jump.wall.exhaustion").depends(_jumpExhaustion).comment("To switch on/off wall jump exhaustion").chapter();
|
||||
public final Property<Float> _wallJumpExhaustionGainFactor = PositiveFactor("move.jump.wall.exhaustion.gain.factor").comment("To manipulate the exhaustion increase by a wall jump (>= 0)");
|
||||
public final Property<Float> _wallJumpExhaustionStopFactor = PositiveFactor("move.jump.wall.exhaustion.stop.factor").comment("To manipulate maximum exhaustion to wall jump (>= 0)");
|
||||
|
||||
public final Property<Boolean> _wallUpJumpExhaustion = Unmodified("move.jump.wall.up.exhaustion").depends(_wallJumpExhaustion).comment("To switch on/off wall up jump exhaustion").section();
|
||||
public final Property<Float> _wallUpJumpExhaustionGainFactor = PositiveFactor("move.jump.wall.up.exhaustion.gain.factor").defaults(40F).comment("To manipulate the exhaustion increase by a wall up jump (>= 0)");
|
||||
public final Property<Float> _wallUpJumpExhaustionStopFactor = PositiveFactor("move.jump.wall.up.exhaustion.stop.factor").defaults(60F).comment("To manipulate maximum exhaustion to wall up jump (>= 0)");
|
||||
|
||||
public final Property<Boolean> _wallHeadJumpExhaustion = Unmodified("move.jump.wall.head.exhaustion").depends(_wallJumpExhaustion).comment("To switch on/off wall head jump exhaustion").section();
|
||||
public final Property<Float> _wallHeadJumpExhaustionGainFactor = PositiveFactor("move.jump.wall.head.exhaustion.gain.factor").defaults(20F).comment("To manipulate the exhaustion increase by a wall head jump (>= 0)");
|
||||
public final Property<Float> _wallHeadJumpExhaustionStopFactor = PositiveFactor("move.jump.wall.head.exhaustion.stop.factor").defaults(80F).comment("To manipulate maximum exhaustion to wall head jump (>= 0)");
|
||||
|
||||
|
||||
public final Property<Boolean> _standJumpExhaustion = Hard("move.jump.stand.exhaustion").depends(_jumpExhaustion).source(_old_jumpExhaustion, _pre_sm_1_7).comment("To switch on/off stand jump exhaustion").chapter();
|
||||
public final Property<Float> _standJumpExhaustionGainFactor = PositiveFactor("move.jump.stand.exhaustion.gain.factor").defaults(40F).source(_old_jumpExhaustionGain, _pre_sm_1_7).comment("To manipulate the exhaustion increase by a jump while standing (>= 0)");
|
||||
public final Property<Float> _standJumpExhaustionStopFactor = PositiveFactor("move.jump.stand.exhaustion.stop.factor").defaults(60F).source(_old_jumpExhaustionStop, _pre_sm_1_7).comment("To manipulate maximum exhaustion to jump while standing (>= 0)");
|
||||
|
||||
public final Property<Boolean> _sneakJumpExhaustion = Hard("move.jump.sneak.exhaustion").depends(_jumpExhaustion).source(_old_sneakJumpExhaustion, _pre_sm_1_7).comment("To switch on/off sneak jump exhaustion").section();
|
||||
public final Property<Float> _sneakJumpExhaustionGainFactor = PositiveFactor("move.jump.sneak.exhaustion.gain.factor").up(40F, _standJumpExhaustionGainFactor).source(_old_sneakJumpExhaustionGain, _pre_sm_1_7).comment("To manipulate the exhaustion increase by a jump while sneaking (>= \"move.jump.stand.exhaustion.gain.factor\")");
|
||||
public final Property<Float> _sneakJumpExhaustionStopFactor = PositiveFactor("move.jump.sneak.exhaustion.stop.factor").down(60F, _standJumpExhaustionStopFactor).source(_old_sneakJumpExhaustionStop, _pre_sm_1_7).comment("To manipulate maximum exhaustion to jump while sneaking (>= 0, <= \"move.jump.stand.exhaustion.stop.factor\")");
|
||||
|
||||
public final Property<Boolean> _walkJumpExhaustion = Hard("move.jump.walkexhaustion").depends(_jumpExhaustion).source(_old_jumpExhaustion, _pre_sm_1_7).comment("To switch on/off walk jump exhaustion").section();
|
||||
public final Property<Float> _walkJumpExhaustionGainFactor = PositiveFactor("move.jump.walk.exhaustion.gain.factor").up(45F, _sneakJumpExhaustionGainFactor).source(_old_jumpExhaustionGain, _pre_sm_1_7).comment("To manipulate the exhaustion increase by a jump while walking (>= \"move.jump.sneak.exhaustion.gain.factor\")");
|
||||
public final Property<Float> _walkJumpExhaustionStopFactor = PositiveFactor("move.jump.walk.exhaustion.stop.factor").down(55F, _sneakJumpExhaustionStopFactor).source(_old_jumpExhaustionStop, _pre_sm_1_7).comment("To manipulate maximum exhaustion to jump while walking (>= 0, <= \"move.jump.sneak.exhaustion.stop.factor\")");
|
||||
|
||||
public final Property<Boolean> _runJumpExhaustion = Medium("move.jump.run.exhaustion").depends(_jumpExhaustion).source(_old_runJumpExhaustion, _pre_sm_1_7).comment("To switch on/off run jump exhaustion").section();
|
||||
public final Property<Float> _runJumpExhaustionGainFactor = PositiveFactor("move.jump.run.exhaustion.gain.factor").up(60F, _walkJumpExhaustionGainFactor).source(_old_runJumpExhaustionGain, _pre_sm_1_7).comment("To manipulate the exhaustion increase by a jump while running (>= \"move.jump.walk.exhaustion.gain.factor\")");
|
||||
public final Property<Float> _runJumpExhaustionStopFactor = PositiveFactor("move.jump.run.exhaustion.stop.factor").down(40F, _walkJumpExhaustionStopFactor).source(_old_runJumpExhaustionStop, _pre_sm_1_7).comment("To manipulate maximum exhaustion to jump while running (>= 0, <= \"move.jump.walk.exhaustion.stop.factor\")");
|
||||
|
||||
public final Property<Boolean> _sprintJumpExhaustion = Medium("move.jump.sprint.exhaustion").depends(_jumpExhaustion).source(_old_sprintJumpExhaustion, _pre_sm_1_7).comment("To switch on/off sprint jump exhaustion").section();
|
||||
public final Property<Float> _sprintJumpExhaustionGainFactor = PositiveFactor("move.jump.sprint.exhaustion.gain.factor").up(65F, _runJumpExhaustionGainFactor).source(_old_sprintJumpExhaustionGain, _pre_sm_1_7).comment("To manipulate the exhaustion increase by a jump while sprinting (>= \"move.jump.run.exhaustion.gain.factor\")");
|
||||
public final Property<Float> _sprintJumpExhaustionStopFactor = PositiveFactor("move.jump.sprint.exhaustion.stop.factor").down(35F, _runJumpExhaustionStopFactor).source(_old_sprintJumpExhaustionStop, _pre_sm_1_7).comment("To manipulate maximum exhaustion to jump while sprinting (>= 0, <= \"move.jump.run.exhaustion.stop.factor\")");
|
||||
|
||||
public final Property<Boolean> _jumpChargeExhaustion = Medium("move.jump.charge.exhaustion").depends(_jumpExhaustion).defaults(true, _pre_sm_1_11) .comment("To switch on/off up additional jump charge exhaustion").section();
|
||||
public final Property<Float> _jumpChargeExhaustionGainFactor = PositiveFactor("move.jump.charge.exhaustion.gain.factor").defaults(Value(30F)).comment("To manipulate the additional exhaustion for the higher jump (>= 0, is multiplied with the actual charge factor)");
|
||||
public final Property<Float> _jumpChargeExhaustionStopFactor = PositiveFactor("move.jump.charge.exhaustion.stop.factor").defaults(Value(30F)).comment("To manipulate the subtractional maximum exhaustion to jump higher (>= 0, is multiplied with the actual charge factor)");
|
||||
|
||||
public final Property<Boolean> _jumpSlideExhaustion = Medium("move.jump.slide.exhaustion").depends(_jumpExhaustion).defaults(true, _pre_sm_1_11).comment("To switch on/off slide jump exhaustion").section();
|
||||
public final Property<Float> _jumpSlideExhaustionGainFactor = PositiveFactor("move.jump.slide.exhaustion.gain.factor").defaults(Value(10F)).comment("To manipulate the exhaustion increase by a slide jump (>= 0)");
|
||||
public final Property<Float> _jumpSlideExhaustionStopFactor = PositiveFactor("move.jump.slide.exhaustion.stop.factor").defaults(Value(90F)).comment("To manipulate maximum exhaustion to slide jump (>= 0)");
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _baseExhautionGainFactor = PositiveFactor("move.exhaustion.gain.factor").comment("Exhaustion gain base factor, set to '0' to disable exhaustion (>= 0)").book("Exhaustion", "Below you find the options for the continuous exhaustion gain/loss factors.");
|
||||
public final Property<Float> _baseExhautionLossFactor = PositiveFactor("move.exhaustion.loss.factor").defaults(Value(1F).e(1.2F).h(0.8F)).defaults(1F, _pre_sm_1_5).comment("Exhaustion loss base factor (>= 0)");
|
||||
|
||||
public final Property<Float> _sprintingExhautionLossFactor = PositiveFactor("move.exhaustion.sprint.loss.factor").defaults(0F).comment("Smart sprinting exhaustion loss factor (>= 0)").section();
|
||||
public final Property<Float> _runningExhautionLossFactor = PositiveFactor("move.exhaustion.run.loss.factor").up(0.5F, _sprintingExhautionLossFactor).comment("Standard sprinting exhaustion loss factor while (>= 0, >= \"move.exhaustion.sprint.loss.factor\")");
|
||||
public final Property<Float> _walkingExhautionLossFactor = PositiveFactor("move.exhaustion.walk.loss.factor").up(1F, _runningExhautionLossFactor).comment("Walking exhaustion loss factor (>= 0, >= \"move.exhaustion.run.loss.factor\")");
|
||||
public final Property<Float> _sneakingExhautionLossFactor = PositiveFactor("move.exhaustion.sneak.loss.factor").up(1.5F, _walkingExhautionLossFactor).defaults(1F, _sm_1_1).comment("Sneaking exhaustion loss factor (>= 0, >= \"move.exhaustion.walk.loss.factor\")");
|
||||
public final Property<Float> _standingExhautionLossFactor = PositiveFactor("move.exhaustion.stand.loss.factor").up(2F, _sneakingExhautionLossFactor.maximum(1F)).comment("Standing exhaustion loss factor (>= 1, >= \"move.exhaustion.sneak.loss.factor\")");
|
||||
public final Property<Float> _fallExhautionLossFactor = PositiveFactor("move.exhaustion.fall.loss.factor").up(2.5F, _standingExhautionLossFactor).comment("Falling exhaustion loss factor (>= \"move.exhaustion.stand.loss.factor\")");
|
||||
|
||||
public final Property<Float> _ceilClimbingExhaustionLossFactor = PositiveFactor("move.exhaustion.climb.ceiling.loss.factor").comment("Ceiling climbing exhaustion loss factor (>= 0)").section();
|
||||
public final Property<Float> _climbingExhaustionLossFactor = PositiveFactor("move.exhaustion.climb.loss.factor").comment("Climbing exhaustion loss factor (>= 0)");
|
||||
public final Property<Float> _crawlingExhaustionLossFactor = PositiveFactor("move.exhaustion.crawl.loss.factor").comment("Crawling exhaustion loss factor (>= 0)");
|
||||
public final Property<Float> _dippingExhaustionLossFactor = PositiveFactor("move.exhaustion.dip.loss.factor").comment("Water walking exhaustion loss factor (>= 0)");
|
||||
public final Property<Float> _swimmingExhaustionLossFactor = PositiveFactor("move.exhaustion.swim.loss.factor").comment("Swimming exhaustion loss factor (>= 0)");
|
||||
public final Property<Float> _divingExhaustionLossFactor = PositiveFactor("move.exhaustion.dive.loss.factor").comment("Diving exhaustion loss factor (>= 0)");
|
||||
public final Property<Float> _normalExhaustionLossFactor = PositiveFactor("move.exhaustion.normal.loss.factor").comment("Normal movement exhaustion loss factor (>= 0)");
|
||||
|
||||
public final Property<Boolean> _exhaustionLossHunger = Unmodified("move.exhaustion.hunger").comment("Whether exhaustion loss increases hunger").section();
|
||||
public final Property<Float> _exhaustionLossHungerFactor = PositiveFactor("move.exhaustion.hunger.factor").defaults(Value(0.05F).e(0.02F).h(0.08F)).defaults(0.05F, _pre_sm_1_5).comment("How much hunger is generated for exhaustion loss (>= 0)");
|
||||
public final Property<Float> _exhaustionLossFoodLevelMinimum = Positive("move.exhaustion.food.minimum").defaults(4F).comment("Until which food level exhaustion is continuously reduced");
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _hungerGain = Medium("move.hunger.gain").comment("To switch on/off hunger generation").book("Hunger", "Below you find all hunger gain options.");
|
||||
public final Property<Float> _baseHungerGainFactor = PositiveFactor("move.hunger.gain.factor").defaults(Value(1F).e(0.8F).h(1.2F)).defaults(1F, _pre_sm_1_5).comment("Hunger generation base factor (>= 0)");
|
||||
|
||||
public final Property<Float> _sprintingHungerGainFactor = PositiveFactor("move.hunger.sprint.gain.factor").key("move.hunger.gain.sprint.factor", _pre_sm_1_3).comment("Smart sprinting hunger generation factor (>= 0)").section();
|
||||
public final Property<Float> _runningHungerGainFactor = PositiveFactor("move.hunger.run.gain.factor").key("move.hunger.gain.run.factor", _pre_sm_1_3).defaults(10F).comment("Standard sprinting hunger generation factor (>= 0)");
|
||||
public final Property<Float> _walkingHungerGainFactor = PositiveFactor("move.hunger.walk.gain.factor").key("move.hunger.gain.walk.factor", _pre_sm_1_3).comment("Standard speed movement hunger generation factor (>= 0)");
|
||||
public final Property<Float> _sneakingHungerGainFactor = PositiveFactor("move.hunger.sneak.gain.factor").key("move.hunger.gain.sneak.factor", _pre_sm_1_3).comment("Sneaking hunger generation factor (>= 0)");
|
||||
public final Property<Float> _standingHungerGainFactor = PositiveFactor("move.hunger.stand.gain.factor").defaults(0F).comment("Sneaking hunger generation factor (>= 0)");
|
||||
|
||||
public final Property<Float> _climbingHungerGainFactor = PositiveFactor("move.hunger.climb.gain.factor").key("move.hunger.gain.climb.factor", _pre_sm_1_3).comment("Climbing hunger generation factor (>= 0)").section();
|
||||
public final Property<Float> _crawlingHungerGainFactor = PositiveFactor("move.hunger.crawl.gain.factor").key("move.hunger.gain.crawl.factor", _pre_sm_1_3).comment("Crawling hunger generation factor (>= 0)");
|
||||
public final Property<Float> _ceilClimbingHungerGainFactor = PositiveFactor("move.hunger.climb.gain.ceiling.factor").key("move.hunger.gain.climb.ceiling.factor", _pre_sm_1_3).comment("Ceiling climbing hunger generation factor (>= 0)");
|
||||
public final Property<Float> _swimmingHungerGainFactor = PositiveFactor("move.hunger.swim.gain.factor").key("move.hunger.gain.swim.factor", _pre_sm_1_3).defaults(1.5F).comment("Swimming hunger generation factor (>= 0)");
|
||||
public final Property<Float> _divingHungerGainFactor = PositiveFactor("move.hunger.dive.gain.factor").key("move.hunger.gain.dive.factor", _pre_sm_1_3).defaults(1.5F).comment("Diving hunger generation factor (>= 0)");
|
||||
public final Property<Float> _dippingHungerGainFactor = PositiveFactor("move.hunger.dip.gain.factor").key("move.hunger.gain.dip.factor", _pre_sm_1_3).defaults(1.5F).comment("Water walking hunger generation factor (>= 0)");
|
||||
public final Property<Float> _normalHungerGainFactor = PositiveFactor("move.hunger.normal.gain.factor").key("move.hunger.gain.ground.factor", _pre_sm_1_3).comment("Normal movement hunger generation factor (>= 0)");
|
||||
|
||||
public final Property<Float> _alwaysHungerGain = Positive("move.hunger.always.gain").defaults(Value(0F).h(0.005F)).defaults(0F, _pre_sm_1_5).comment("Basic hunger per tick (>= 0)").section();
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _usageSpeedFactor = DecreasingFactor("move.usage.speed.factor").defaults(0.2F).comment("Speed factor while using an item, if not defined otherwise (>= 0 AND <= 1)").book("Item Usage", "Below you find the options to manipulate the speed factors additionally applied while using an item.");
|
||||
public final Property<Float> _usageSwordSpeedFactor = DecreasingFactor("move.usage.sword.speed.factor").defaults(_usageSpeedFactor).comment("Speed factor while blocking with a sword (>= 0 AND <= 1, defaults to \"move.usage.speed.factor\" when not present)");
|
||||
public final Property<Float> _usageBowSpeedFactor = DecreasingFactor("move.usage.bow.speed.factor").defaults(_usageSpeedFactor).comment("Speed factor while pulling back a bow (>= 0 AND <= 1, defaults to \"move.usage.speed.factor\" when not present)");
|
||||
public final Property<Float> _usageFoodSpeedFactor = DecreasingFactor("move.usage.food.speed.factor").defaults(_usageSpeedFactor).comment("Speed factor while eating food (>= 0 AND <= 1, defaults to \"move.usage.speed.factor\" when not present)");
|
||||
|
||||
public final Property<Boolean> _sprintDuringItemUsage = Modified("move.usage.sprint").comment("To switch on/off generic sprinting while using an item").section();
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _replaceRopeClimbing = Unmodified("move.mod.rope.replace.climb.rope").comment("Whether to replace the rope climbing of mod pack 'Ropes+'").book("Mod compatibility", "Below you find the options to manipulate how Smart Moving should interact with other mods");
|
||||
|
||||
|
||||
|
||||
public final Property<String[]> _survivalConfigKeys = Strings("move.config.survival.keys").singular().defaults(new String[]{"e", "m", "h"}).comment("A list of survival option configuration keys, entries seperated by ','").book("Configuration Management", "Below you find the options to define multiple configuration option sets");
|
||||
public final Property<String> _survivalDefaultConfigKey = String("move.config.survival.keys.default").singular().defaults("m").comment("The option configuration to start the next minecraft survival game with (can also be modified via in-game option configuration toggling)");
|
||||
|
||||
public final Property<String[]> _creativeConfigKeys = Strings("move.config.creative.keys").singular().defaults(new String[]{"c"}).defaults(new String[0], _pre_sm_2_3).comment("A list of creative option configuration keys, entries seperated by ','").section();
|
||||
public final Property<String> _creativeDefaultConfigKey = String("move.config.creative.keys.default").singular().defaults("c").defaults("", _pre_sm_2_3).comment("The option configuration to start the next minecraft creative game with (can also be modified via in-game option configuration toggling)");
|
||||
|
||||
public final Property<String[]> _adventureConfigKeys = Strings("move.config.adventure.keys").singular().defaults(new String[]{"e", "m", "h"}).comment("A list of adventure option configuration keys, entries seperated by ','").section();
|
||||
public final Property<String> _adventureDefaultConfigKey = String("move.config.adventure.keys.default").singular().defaults("m").comment("The option configuration to start the next minecraft adventure game with (can also be modified via in-game option configuration toggling)");
|
||||
|
||||
public final Property<String> _configKeyName = String("move.config.key.name").defaults(Value((String)null).e("Easy").m("Medium").h("Hard")).comment("The display names of the option configuration keys").section();
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _serverConfig = Modified("move.server.config").singular().comment("Whether the players on this server should be forced to use the configurations on this server").book("Server Management", "Below you find the options to manage your server");
|
||||
|
||||
public final Property<Map<String,String>> _survivalDefaultConfigUserKeys = StringMap("move.server.config.survival.user.keys").singular().comment("The option configuration to start the player's next minecraft survival game with (can also be modified via in-game option configuration toggling)").section();
|
||||
public final Property<Map<String,String>> _creativeDefaultConfigUserKeys = StringMap("move.server.config.creative.user.keys").singular().comment("The option configuration to start the player's next minecraft creative game with (can also be modified via in-game option configuration toggling)");
|
||||
public final Property<Map<String,String>> _adventureDefaultConfigUserKeys = StringMap("move.server.config.adventure.user.keys").singular().comment("The option configuration to start the player's next minecraft adventure game with (can also be modified via in-game option configuration toggling)");
|
||||
public final Property<Map<String,Integer>> _speedUsersExponents = IntegerMap("move.server.speed.user.exponents").singular().comment("The user specific exponents for in-game speed manipulation");
|
||||
|
||||
public final Property<Boolean> _globalConfig = Modified("move.global.config").key("move.config.overwrite", _pre_sm_3_0).key("move.config.send", _pre_sm_2_2).singular().depends(_serverConfig).comment("Whether all players on this server should be forced to use the same global configuration (Relevant only if \"move.server.config\" is true)").section();
|
||||
|
||||
public final Property<String[]> _usersWithChangeConfigRights = Strings("move.global.config.right.user.names").singular().comment("The names of the users that have the right to change the global configuraton in-game, entries seperated by ','").section();
|
||||
public final Property<String[]> _usersWithChangeSpeedRights = Strings("move.global.speed.right.user.names").singular().comment("The names of the users that have the right to change the global speed in-game, entries seperated by ','");
|
||||
|
||||
|
||||
|
||||
public void changeSpeed(int difference)
|
||||
{
|
||||
_speedUserExponent.setValue(_speedUserExponent.value + difference);
|
||||
}
|
||||
|
||||
public boolean isUserSpeedEnabled()
|
||||
{
|
||||
return enabled && _speedUser.value;
|
||||
}
|
||||
|
||||
public boolean isUserSpeedAlwaysDefault()
|
||||
{
|
||||
return !_speedUser.value || _speedUserFactor.value == 1F;
|
||||
}
|
||||
|
||||
public float getUserSpeedFactor()
|
||||
{
|
||||
if(isUserSpeedAlwaysDefault() || _speedUserExponent.value == 0)
|
||||
return 1F;
|
||||
return (float)Math.pow(1F + _speedUserFactor.value, _speedUserExponent.value);
|
||||
}
|
||||
|
||||
protected void loadFromProperties(Properties properties)
|
||||
{
|
||||
try
|
||||
{
|
||||
load(properties);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new RuntimeException("Could not load Smart Moving properties from properties", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeToProperties(Properties properties, List<Property<?>> except)
|
||||
{
|
||||
try
|
||||
{
|
||||
write(properties);
|
||||
|
||||
if(except != null)
|
||||
for(int i = 0; i < except.size(); i++)
|
||||
{
|
||||
String key = except.get(i).getCurrentKey();
|
||||
if(key != null)
|
||||
properties.remove(key);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new RuntimeException("Could not write Smart Moving properties to properties", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void loadFromOptionsFile(File optionsPath)
|
||||
{
|
||||
Properties slcs_properties = new Properties(_slcs, new File(optionsPath, _smartLadderClimbingSpeedPropertiesFileName));
|
||||
Properties sc_properties = new Properties(_sc, new File(optionsPath, _smartClimbingPropertiesFileName));
|
||||
Properties sm_cs_properties = new Properties(new File(optionsPath, _smartMovingClientServerPropertiesFileName));
|
||||
Properties properties = new Properties(new File(optionsPath, _smartMovingPropertiesFileName));
|
||||
|
||||
try
|
||||
{
|
||||
load(properties, sm_cs_properties, sc_properties, slcs_properties);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new RuntimeException("Could not load Smart Moving properties from file", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void saveToOptionsFile(File optionsPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
save(new File(optionsPath, _smartMovingPropertiesFileName), _sm_current, true, true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new RuntimeException("Could not save Smart Moving properties to file", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void printHeader(PrintWriter printer)
|
||||
{
|
||||
printer.println("#######################################################################");
|
||||
printer.println("#");
|
||||
printer.println("# Smart Moving mod configuration file");
|
||||
printer.println("# -----------------------------------");
|
||||
printer.println("#");
|
||||
printer.println("# Modify the values behind the keys in this file to configure the");
|
||||
printer.println("# Smart Moving behavior as you like it.");
|
||||
printer.println("#");
|
||||
printer.println("# * All options you leave at their default value will be automatically");
|
||||
printer.println("# updated when the default value is updated with a new version of");
|
||||
printer.println("# Smart Moving options.");
|
||||
printer.println("#");
|
||||
printer.println("# * All options you modify will stay the same over the upgrade cycles");
|
||||
printer.println("# as long as they still fall in the allowed range.");
|
||||
printer.println("#");
|
||||
printer.println("# * The character '!' will be used after the value's text's end to");
|
||||
printer.println("# mark a value that has originally been modified but became the");
|
||||
printer.println("# default value at some point in the update process to avoid it being");
|
||||
printer.println("# updated too with the next default value change.");
|
||||
printer.println("#");
|
||||
printer.println("# * The '!' mark can also be used to create a 'modified' and so not");
|
||||
printer.println("# automatically updated value identical to the current default value");
|
||||
printer.println("#");
|
||||
printer.println("# Additionally you can create multiple option configurations and define");
|
||||
printer.println("# separate option values for each configuration.");
|
||||
printer.println("#");
|
||||
printer.println("# * key-value separator is ':'");
|
||||
printer.println("# * key-value-pair separator is ';'");
|
||||
printer.println("# * a value without key will become the default value");
|
||||
printer.println("#");
|
||||
printer.println("#######################################################################");
|
||||
printer.println();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void printVersion(PrintWriter printer, String version, boolean comments)
|
||||
{
|
||||
if(comments)
|
||||
printer.println("# The current version of this Smart Moving options file");
|
||||
|
||||
printer.print("move.options.version");
|
||||
printer.print(":");
|
||||
printer.print(version);
|
||||
printer.println();
|
||||
}
|
||||
|
||||
private static Property<Boolean> Creative(String key, String... versions)
|
||||
{
|
||||
return Modified(key, versions).defaults(Value(false).c(true));
|
||||
}
|
||||
|
||||
private static Property<Boolean> Hard(String key, String... versions)
|
||||
{
|
||||
return Modified(key, versions).defaults(Value(false).h(true)).defaults(false, _pre_sm_1_5);
|
||||
}
|
||||
|
||||
private static Property<Boolean> Medium(String key, String... versions)
|
||||
{
|
||||
return Unmodified(key, versions).defaults(Value(true).e(false)).defaults(true, _pre_sm_1_5);
|
||||
}
|
||||
|
||||
protected final static int Unknown = -1;
|
||||
protected final static int Survival = 0;
|
||||
protected final static int Creative = 1;
|
||||
protected final static int Adventure = 2;
|
||||
|
||||
public Object getSpeedPercent()
|
||||
{
|
||||
float factor = getUserSpeedFactor() * 100F;
|
||||
int fraction = 0;
|
||||
while(factor < 100F)
|
||||
{
|
||||
fraction++;
|
||||
factor *= 10F;
|
||||
}
|
||||
|
||||
int significant = Math.round(factor);
|
||||
BigDecimal decimal = new BigDecimal(significant);
|
||||
while(fraction-- > 0)
|
||||
decimal = decimal.divide(ten);
|
||||
return formatter.format(decimal);
|
||||
}
|
||||
|
||||
private final static DecimalFormat formatter = new DecimalFormat("0.############################################################");
|
||||
private final static BigDecimal ten = new BigDecimal(10);
|
||||
public final static Object defaultSpeedPercent = "100";
|
||||
}
|
||||
@@ -1,391 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.gui.*;
|
||||
import net.minecraft.client.multiplayer.*;
|
||||
import net.minecraft.client.resources.*;
|
||||
import net.minecraft.client.settings.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.WorldSettings.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
import net.smart.properties.*;
|
||||
import net.smart.utilities.*;
|
||||
|
||||
public class SmartMovingOptions extends SmartMovingClientConfig
|
||||
{
|
||||
public final Property<Boolean> _localUserHasChangeConfigRight = Unmodified("move.global.config.right.local.user").comment("Whether the current local user has the right to change the global configuration in-game (despite of the names listed in \"move.global.config.right.user.names\"").section();
|
||||
public final Property<Boolean> _localUserHasChangeSpeedRight = Unmodified("move.global.speed.right.local.user").comment("Whether the current local user has the right to change the global speed in-game (despite of the names listed in \"move.global.config.right.user.names\"");
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _perspectiveFadeFactor = PositiveFactor("move.perspective.fade.factor").values(0.5F, 0.1F, 1F).comment("Fading speed factor between the different perspectives (>= 0.1, <= 1, set to '1' to switch off)").book("Viewpoint perspective", "Below you find the options to manipulate the viewpoint perspective");
|
||||
public final Property<Float> _perspectiveRunFactor = Float("move.perspective.run.factor").key("move.run.perspective.factor", _pre_sm_2_1).defaults(1F).comment("Standard sprinting perspective (set to '0' to switch off)");
|
||||
public final Property<Float> _perspectiveSprintFactor = Float("move.perspective.sprint.factor").key("move.sprint.perspective.factor", _pre_sm_2_1).defaults(1.5F).comment("Smart on ground sprinting perspective (set to '0' to switch off)");
|
||||
|
||||
|
||||
|
||||
public final Property<Float> _angleJumpDoubleClickTicks = Positive("move.jump.angle.double.click.ticks").singular().up(3F, 2F).comment("The maximum number of ticks between two clicks to trigger a side or back jump (>= 2)").book("User interface", "Below you find the options to manipulate Smart Moving's user interface");
|
||||
|
||||
public final Property<Boolean> _wallJumpDoubleClick = Unmodified("move.jump.wall.double.click").singular().comment("Whether wall jumping should be triggered by single or double clicking (and then press and holding) the jump button").section();
|
||||
public final Property<Float> _wallJumpDoubleClickTicks = Positive("move.jump.wall.double.click.ticks").singular().up(3F, 2F).comment("The maximum number of ticks between two clicks to trigger a wall jump (>= 2, depends on \"move.jump.wall.double.click\")");
|
||||
|
||||
public final Property<Boolean> _climbJumpBackHeadOnGrab = Unmodified("move.jump.climb.back.head.on.grab").singular().comment("Whether pressing or not pressing the grab button while climb jumping back results in a head jump").section();
|
||||
|
||||
public final Property<Boolean> _displayExhaustionBar = Unmodified("move.gui.exhaustion.bar").singular().comment("Whether to display the exhaustion bar in the game overlay").section();
|
||||
public final Property<Boolean> _displayJumpChargeBar = Unmodified("move.gui.jump.charge.bar").singular().comment("Whether to display the jump charge bar in the game overlay");
|
||||
|
||||
public final Property<Boolean> _sneakToggle = Modified("move.sneak.toggle").comment("To switch on/off sneak toggling").section();
|
||||
public final Property<Boolean> _crawlToggle = Modified("move.crawl.toggle").comment("To switch on/off crawl toggling");
|
||||
|
||||
public final Property<Boolean> _flyCloseToGround = Modified("move.fly.ground.close").comment("To switch on/off flying close to the ground").section();
|
||||
public final Property<Boolean> _flyWhileOnGround = Modified("move.fly.ground.collide").depends(_flyCloseToGround).comment("To switch on/off flying while colliding with the grond (Relevant only if \"move.fly.ground.close\" is true)");
|
||||
|
||||
public final Property<Boolean> _flyControlVertical = Unmodified("move.fly.control.vertical").comment("Whether flying control also depends on where the player looks vertically.").section();
|
||||
public final Property<Boolean> _diveControlVertical = Unmodified("move.dive.control.vertical").comment("Whether diving control also depends on where the player looks vertically.");
|
||||
|
||||
private final Property<Integer> _old_toggleKeyCode = Integer("move.toggle.key", _pre_sm_1_7).singular().defaults(67);
|
||||
private final Property<String> _defaultConfigToggleKeyName = String("move.config.toggle.default.key.name").key("move.toggle.key.name", _pre_sm_3_2).singular().defaults("F9").source(_old_toggleKeyCode.toKeyName(), _pre_sm_1_7).singular().comment("Key name to toggle Smart Moving features in-game (default: \"F9\")").section();
|
||||
private final Property<String> _defaultGrabKeyName = String("move.grab.default.key.name").singular().defaults("LCONTROL").singular().comment("Default key name to \"grab\" (default: \"LCONTROL\")");
|
||||
private final Property<String> _speedIncreaseKeyName = String("move.speed.increase.default.key.name").key("move.speed.increase.key.name", _pre_sm_3_2).singular().defaults("O").singular().comment("Key name to increase the moving speed ingame (default: \"O\")");
|
||||
private final Property<String> _speedDecreaseKeyName = String("move.speed.decrease.default.key.name").key("move.speed.decrease.key.name", _pre_sm_3_2).singular().defaults("I").singular().comment("Key name to decrease the moving speed ingame (default: \"I\")");
|
||||
|
||||
public final Property<Integer> _defaultConfigToggleKeyCode = _defaultConfigToggleKeyName.toKeyCode(67);
|
||||
public final Property<Integer> _defaultGrabKeyCode = _defaultGrabKeyName.toKeyCode(29);
|
||||
public final Property<Integer> _defaultSpeedIncreaseKeyCode = _speedIncreaseKeyName.toKeyCode(24);
|
||||
public final Property<Integer> _defaultSpeedDecreaseKeyCode = _speedDecreaseKeyName.toKeyCode(23);
|
||||
|
||||
|
||||
|
||||
public final Property<Boolean> _configChat = Unmodified("move.config.chat").singular().comment("To switch on/off option status messages via chat system").book("Message Management", "Below you find the options to define in which case Smart Moving should write messages about its current behavior to the ingame chat");
|
||||
public final Property<Boolean> _configChatInit = Unmodified("move.config.chat.init").depends(_configChat).singular().comment("To switch on/off the initial option status message when starting a game (Relevant only if \"move.config.chat\" is not false)");
|
||||
public final Property<Boolean> _configChatInitHelp = Unmodified("move.config.chat.init.help").depends(_configChatInit).singular().comment("To switch on/off the initial option help message (Relevant only if \"move.config.chat.init\" is not false and no improved keybinding GUI (Minecraft Forge or the Macros/Keybind mod) is installed)");
|
||||
public final Property<Boolean> _configChatServer = Unmodified("move.config.chat.server").depends(_configChat).singular().comment("To switch on/off the server config overridden status message when joining a multiplayer game (Relevant only if \"move.config.chat\" is not false)");
|
||||
|
||||
public final Property<Boolean> _speedChat = Unmodified("move.speed.chat").singular().comment("To switch on/off speed messages via chat system").section();
|
||||
public final Property<Boolean> _speedChatInit = Unmodified("move.speed.chat.init").depends(_speedChat).singular().comment("To switch on/off the intial speed message when starting a game (Relevant only if \"move.speed.chat\" is not false)");
|
||||
public final Property<Boolean> _speedChatInitHelp = Unmodified("move.speed.chat.init.help").depends(_speedChatInit).singular().comment("To switch on/off the initial speed help message (Relevant only if \"move.speed.chat.init\" is not false and no improved keybinding GUI (Minecraft Forge or the Macros/Keybind mod) is installed))");
|
||||
public final Property<Boolean> _speedChatServer = Unmodified("move.config.chat.server").depends(_speedChat).singular().comment("To switch on/off the server speed change message when joining a multiplayer game (Relevant only if \"move.speed.chat\" is not false)");
|
||||
|
||||
|
||||
public KeyBinding keyBindGrab;
|
||||
public KeyBinding keyBindConfigToggle;
|
||||
public KeyBinding keyBindSpeedIncrease;
|
||||
public KeyBinding keyBindSpeedDecrease;
|
||||
|
||||
public static final File optionsPath = net.minecraft.client.Minecraft.getMinecraft().mcDataDir;
|
||||
|
||||
public SmartMovingOptions()
|
||||
{
|
||||
loadFromOptionsFile(optionsPath);
|
||||
saveToOptionsFile(optionsPath);
|
||||
|
||||
keyBindGrab = new KeyBinding("key.climb", _defaultGrabKeyCode.value, "key.categories.gameplay");
|
||||
keyBindConfigToggle = new KeyBinding("key.config.toggle", _defaultConfigToggleKeyCode.value, "key.categories.smartmoving");
|
||||
keyBindSpeedIncrease = new KeyBinding("key.speed.increase", _defaultSpeedIncreaseKeyCode.value, "key.categories.smartmoving");
|
||||
keyBindSpeedDecrease = new KeyBinding("key.speed.decrease", _defaultSpeedDecreaseKeyCode.value, "key.categories.smartmoving");
|
||||
}
|
||||
|
||||
public boolean isSneakToggleEnabled()
|
||||
{
|
||||
return _sneakToggle.value && enabled;
|
||||
}
|
||||
|
||||
public boolean isCrawlToggleEnabled()
|
||||
{
|
||||
return _crawlToggle.value && enabled;
|
||||
}
|
||||
|
||||
public int angleJumpDoubleClickTicks()
|
||||
{
|
||||
return (int)Math.ceil(_angleJumpDoubleClickTicks.value);
|
||||
}
|
||||
|
||||
public int wallJumpDoubleClickTicks()
|
||||
{
|
||||
return (int)Math.ceil(_wallJumpDoubleClickTicks.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggle()
|
||||
{
|
||||
super.toggle();
|
||||
if(_configChat.value)
|
||||
writeClientConfigMessageToChat(false);
|
||||
|
||||
Property<String> defaultKey = null;
|
||||
switch(gameType)
|
||||
{
|
||||
default:
|
||||
case Survival:
|
||||
defaultKey = _survivalDefaultConfigKey;
|
||||
break;
|
||||
case Creative:
|
||||
defaultKey = _creativeDefaultConfigKey;
|
||||
break;
|
||||
case Adventure:
|
||||
defaultKey = _adventureDefaultConfigKey;
|
||||
break;
|
||||
}
|
||||
|
||||
if(defaultKey != null)
|
||||
{
|
||||
String currentKey = getCurrentKey();
|
||||
defaultKey.setValue(currentKey);
|
||||
saveToOptionsFile(optionsPath);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeSpeed(int difference)
|
||||
{
|
||||
super.changeSpeed(difference);
|
||||
writeClientSpeedMessageToChat(false);
|
||||
saveToOptionsFile(optionsPath);
|
||||
}
|
||||
|
||||
private void writeClientConfigMessageToChat(boolean everyone)
|
||||
{
|
||||
String prefix = getClientEveryonePrefix("move.config.chat.client", everyone);
|
||||
if(SmartMovingContext.Config.enabled)
|
||||
{
|
||||
String name = SmartMovingContext.Config._configKeyName.value;
|
||||
if(name.isEmpty())
|
||||
name = null;
|
||||
|
||||
boolean unnamed = name == null;
|
||||
if(unnamed)
|
||||
name = getCurrentKey();
|
||||
|
||||
if(name == SmartMovingProperties.Enabled || (unnamed && getKeyCount() == 1))
|
||||
writeToChat(prefix + "enabled", SmartMovingInfo.ConfigChatId);
|
||||
else
|
||||
writeToChat(prefix + (unnamed ? "unnamed" : "named"), SmartMovingInfo.ConfigChatId, new Object[] { name });
|
||||
}
|
||||
else
|
||||
writeToChat(prefix + "disabled", SmartMovingInfo.ConfigChatId);
|
||||
}
|
||||
|
||||
public void writeClientSpeedMessageToChat(boolean everyone)
|
||||
{
|
||||
if(!_speedChat.value)
|
||||
return;
|
||||
|
||||
Object percent = SmartMovingContext.Config.getSpeedPercent();
|
||||
String prefix = getClientEveryonePrefix("move.speed.chat.client", everyone);
|
||||
String key = prefix + (percent.equals(SmartMovingConfig.defaultSpeedPercent) ? "reset" : "change");
|
||||
writeToChat(key, SmartMovingInfo.SpeedChatId, percent);
|
||||
}
|
||||
|
||||
private static String getClientEveryonePrefix(String base, boolean everyone)
|
||||
{
|
||||
String result = base + ".";
|
||||
if(everyone)
|
||||
result += "everyone.";
|
||||
return result;
|
||||
}
|
||||
|
||||
public void writeServerConfigMessageToChat()
|
||||
{
|
||||
if(!_configChatServer.value)
|
||||
return;
|
||||
|
||||
if(SmartMovingContext.Config.enabled)
|
||||
{
|
||||
String configName = SmartMovingContext.Config._configKeyName.value;
|
||||
if(configName != null && !configName.isEmpty())
|
||||
writeToChat("move.config.chat.server.global.named", SmartMovingInfo.DefaultChatId, configName);
|
||||
else
|
||||
writeToChat("move.config.chat.server.global.unnamed", SmartMovingInfo.DefaultChatId);
|
||||
}
|
||||
else
|
||||
writeToChat("move.config.chat.server.disable", SmartMovingInfo.DefaultChatId);
|
||||
}
|
||||
|
||||
public void writeServerReconfigMessageToChat(boolean wasEnabled, String username, boolean everyone)
|
||||
{
|
||||
if(Minecraft.getMinecraft().thePlayer.getGameProfile().getName().equals(username))
|
||||
writeClientConfigMessageToChat(everyone);
|
||||
else if(_configChatServer.value)
|
||||
{
|
||||
if(SmartMovingContext.Config.enabled)
|
||||
{
|
||||
String configname = SmartMovingContext.Config._configKeyName.value;
|
||||
boolean hasConfigName = configname != null && !configname.isEmpty();
|
||||
if(wasEnabled)
|
||||
if(hasConfigName)
|
||||
if(username != null)
|
||||
writeToChat("move.config.chat.server.update.named.user", SmartMovingInfo.ConfigChatId, configname, username);
|
||||
else
|
||||
writeToChat("move.config.chat.server.update.named", SmartMovingInfo.ConfigChatId, configname);
|
||||
else
|
||||
if(username != null)
|
||||
writeToChat("move.config.chat.server.update.unnamed.user", SmartMovingInfo.ConfigChatId, username);
|
||||
else
|
||||
writeToChat("move.config.chat.server.update.unnamed", SmartMovingInfo.ConfigChatId);
|
||||
else
|
||||
if(hasConfigName)
|
||||
if(username != null)
|
||||
writeToChat("move.config.chat.server.update.named.user", SmartMovingInfo.ConfigChatId, configname, username);
|
||||
else
|
||||
writeToChat("move.config.chat.server.update.named", SmartMovingInfo.ConfigChatId, configname);
|
||||
else
|
||||
if(username != null)
|
||||
writeToChat("move.config.chat.server.enable.user", SmartMovingInfo.ConfigChatId, username);
|
||||
else
|
||||
writeToChat("move.config.chat.server.enable", SmartMovingInfo.ConfigChatId);
|
||||
}
|
||||
else if(wasEnabled)
|
||||
if(username != null)
|
||||
writeToChat("move.config.chat.server.disable.user", SmartMovingInfo.ConfigChatId, username);
|
||||
else
|
||||
writeToChat("move.config.chat.server.disable", SmartMovingInfo.ConfigChatId);
|
||||
}
|
||||
}
|
||||
|
||||
public void writeServerDeconfigMessageToChat()
|
||||
{
|
||||
if(_configChatServer.value)
|
||||
writeToChat("move.config.chat.server.local", SmartMovingInfo.DefaultChatId);
|
||||
}
|
||||
|
||||
public void writeServerSpeedMessageToChat(String username, boolean everyone)
|
||||
{
|
||||
if(Minecraft.getMinecraft().thePlayer.getGameProfile().getName().equals(username))
|
||||
writeClientSpeedMessageToChat(everyone);
|
||||
else if(_speedChatServer.value)
|
||||
{
|
||||
Object percent = SmartMovingContext.Config.getSpeedPercent();
|
||||
String prefix = "move.speed.chat.server.";
|
||||
if(percent.equals(SmartMovingConfig.defaultSpeedPercent))
|
||||
writeToChat(prefix + "reset", SmartMovingInfo.SpeedChatId, username);
|
||||
else
|
||||
writeToChat(prefix + "change", SmartMovingInfo.SpeedChatId, percent, username);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeNoRightsToChangeConfigMessageToChat(boolean isRemote)
|
||||
{
|
||||
writeToChat("move.config.chat.server.illegal." + (isRemote ? "remote" : "local"), SmartMovingInfo.ConfigChatId);
|
||||
}
|
||||
|
||||
public static void writeNoRightsToChangeSpeedMessageToChat(boolean isRemote)
|
||||
{
|
||||
writeToChat("move.speed.chat.server.illegal." + (isRemote ? "remote" : "local"), SmartMovingInfo.SpeedChatId);
|
||||
}
|
||||
|
||||
private static void writeToChat(String key, int id, Object... parameters)
|
||||
{
|
||||
String message = parameters == null || parameters.length == 0
|
||||
? I18n.format(key)
|
||||
: I18n.format(key, parameters);
|
||||
|
||||
GuiNewChat guiChat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
|
||||
|
||||
// bugfix: also delete multi-lined chat messages
|
||||
if(id != 0)
|
||||
for(int i=0; i<5; i++)
|
||||
guiChat.deleteChatLine(id);
|
||||
|
||||
guiChat.printChatMessageWithOptionalDeletion(new ChatComponentText(message), id);
|
||||
}
|
||||
|
||||
public static void initialize(boolean redPowerWiring, boolean buildCraftTransportation, boolean finiteLiquid, boolean betterThanWolves, boolean singlePlayerCommands, boolean ropesPlus, boolean aSGrapplingHook, boolean betterMisc)
|
||||
{
|
||||
hasRedPowerWire = redPowerWiring;
|
||||
hasBuildCraftTransportation = buildCraftTransportation;
|
||||
hasFiniteLiquid = finiteLiquid;
|
||||
hasBetterThanWolves = betterThanWolves;
|
||||
hasSinglePlayerCommands = singlePlayerCommands;
|
||||
hasRopesPlus = ropesPlus;
|
||||
hasASGrapplingHook = aSGrapplingHook;
|
||||
hasBetterMisc = betterMisc;
|
||||
}
|
||||
|
||||
public void resetForNewGame()
|
||||
{
|
||||
gameType = -1;
|
||||
}
|
||||
|
||||
public void initializeForGameIfNeccessary()
|
||||
{
|
||||
PlayerControllerMP controller = Minecraft.getMinecraft().playerController;
|
||||
if(controller == null)
|
||||
return;
|
||||
|
||||
int currentGameType = ((GameType)Reflect.GetField(_currentGameType, controller)).getID();
|
||||
if(currentGameType == gameType)
|
||||
return;
|
||||
|
||||
gameType = currentGameType;
|
||||
|
||||
String[] keys = null;
|
||||
String defaultKey = null;
|
||||
|
||||
switch(gameType)
|
||||
{
|
||||
case Survival:
|
||||
keys = _survivalConfigKeys.value;
|
||||
defaultKey = _survivalDefaultConfigKey.value;
|
||||
break;
|
||||
case Creative:
|
||||
keys = _creativeConfigKeys.value;
|
||||
defaultKey = _creativeDefaultConfigKey.value;
|
||||
break;
|
||||
case Adventure:
|
||||
keys = _adventureConfigKeys.value;
|
||||
defaultKey = _adventureDefaultConfigKey.value;
|
||||
break;
|
||||
default:
|
||||
defaultKey = "";
|
||||
}
|
||||
|
||||
setKeys(keys);
|
||||
if(!defaultKey.isEmpty())
|
||||
setCurrentKey(defaultKey);
|
||||
|
||||
if(_configChatInit.value)
|
||||
writeClientConfigMessageToChat(false);
|
||||
|
||||
if(isUserSpeedEnabled() && _speedChatInit.value)
|
||||
{
|
||||
Object speedPercent = getSpeedPercent();
|
||||
|
||||
if(!speedPercent.equals(defaultSpeedPercent))
|
||||
writeToChat("move.speed.chat.client.init", SmartMovingInfo.DefaultChatId, speedPercent);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasRedPowerWire = false;
|
||||
public static boolean hasBuildCraftTransportation = false;
|
||||
public static boolean hasFiniteLiquid = false;
|
||||
public static boolean hasBetterThanWolves = false;
|
||||
public static boolean hasSinglePlayerCommands = false;
|
||||
public static boolean hasRopesPlus = false;
|
||||
public static boolean hasASGrapplingHook = false;
|
||||
public static boolean hasBetterMisc = false;
|
||||
|
||||
public int gameType;
|
||||
|
||||
private static Field _currentGameType = Reflect.GetField(PlayerControllerMP.class, SmartMovingInstall.PlayerControllerMP_currentGameType);
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.smart.properties.*;
|
||||
import net.smart.properties.Properties;
|
||||
|
||||
public abstract class SmartMovingProperties extends Properties
|
||||
{
|
||||
public final static String Enabled = "enabled";
|
||||
public final static String Disabled = "disabled";
|
||||
private final static String[] _defaultKeys = new String[1];
|
||||
|
||||
private int toggler = -2;
|
||||
private String[] keys = _defaultKeys;
|
||||
|
||||
public boolean enabled;
|
||||
|
||||
protected void load(Properties... propertiesList) throws Exception
|
||||
{
|
||||
List<Property<?>> propertiesToLoad = getProperties();
|
||||
if(toggler != -2)
|
||||
{
|
||||
Iterator<Property<?>> iterator = propertiesToLoad.iterator();
|
||||
while(iterator.hasNext())
|
||||
iterator.next().reset();
|
||||
}
|
||||
|
||||
while (propertiesToLoad.size() > 0)
|
||||
{
|
||||
Iterator<Property<?>> iterator = propertiesToLoad.iterator();
|
||||
while(iterator.hasNext())
|
||||
if(iterator.next().load(propertiesList))
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
toggler = 0;
|
||||
update();
|
||||
}
|
||||
|
||||
protected void save(File file, String version, boolean header, boolean comments) throws Exception
|
||||
{
|
||||
List<Property<?>> propertiesToSave = getProperties();
|
||||
|
||||
FileOutputStream stream = new FileOutputStream(file);
|
||||
PrintWriter printer = new PrintWriter(stream);
|
||||
|
||||
if(header)
|
||||
printHeader(printer);
|
||||
|
||||
if(version != null)
|
||||
printVersion(printer, version, comments);
|
||||
|
||||
for(int i = 0; i < propertiesToSave.size(); i++)
|
||||
if(propertiesToSave.get(i).print(printer, keys, version, comments) && i < propertiesToSave.size() - 1)
|
||||
printer.println();
|
||||
|
||||
printer.close();
|
||||
}
|
||||
|
||||
protected abstract void printVersion(PrintWriter printer, String version, boolean comments);
|
||||
|
||||
protected abstract void printHeader(PrintWriter printer);
|
||||
|
||||
public void toggle()
|
||||
{
|
||||
int length = keys == null ? 0 : keys.length;
|
||||
toggler++;
|
||||
if(toggler == length)
|
||||
toggler = -1;
|
||||
update();
|
||||
}
|
||||
|
||||
public void setKeys(String[] keys)
|
||||
{
|
||||
if(keys == null || keys.length == 0)
|
||||
keys = _defaultKeys;
|
||||
this.keys = keys;
|
||||
toggler = 0;
|
||||
update();
|
||||
}
|
||||
|
||||
public String getKey(int index)
|
||||
{
|
||||
if(keys[index] == null)
|
||||
return Enabled;
|
||||
return keys[index];
|
||||
}
|
||||
|
||||
public String getNextKey(String key)
|
||||
{
|
||||
if(key == null || key.equals("disabled"))
|
||||
return getKey(0);
|
||||
int index;
|
||||
for(index = 0; index < keys.length; index++)
|
||||
if(key.equals(keys[index]))
|
||||
break;
|
||||
index++;
|
||||
if(index < keys.length)
|
||||
return keys[index];
|
||||
return Disabled;
|
||||
}
|
||||
|
||||
public void setCurrentKey(String key)
|
||||
{
|
||||
if(key == null || key.equals(Disabled))
|
||||
toggler = -1;
|
||||
else if(keys.length == 1 && keys[0] == null && key.equals(Enabled))
|
||||
toggler = 0;
|
||||
else
|
||||
{
|
||||
for(toggler = 0; toggler < keys.length; toggler++)
|
||||
if(key.equals(keys[toggler]))
|
||||
break;
|
||||
|
||||
if(toggler == keys.length)
|
||||
toggler = -1;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
public String getCurrentKey()
|
||||
{
|
||||
if(toggler == -1)
|
||||
return Disabled;
|
||||
return keys[toggler];
|
||||
}
|
||||
|
||||
public boolean hasKey(String key)
|
||||
{
|
||||
if(Enabled.equals(key))
|
||||
return keys[0] == null;
|
||||
if(Disabled.equals(key))
|
||||
return true;
|
||||
|
||||
for(int i = 0; i < keys.length; i++)
|
||||
if(key == null && keys[i] == null || key != null && key.equals(keys[i]))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getKeyCount()
|
||||
{
|
||||
return keys.length;
|
||||
}
|
||||
|
||||
protected void update()
|
||||
{
|
||||
List<Property<?>> properties = getProperties();
|
||||
Iterator<Property<?>> iterator = properties.iterator();
|
||||
|
||||
String currentKey = getCurrentKey();
|
||||
while(iterator.hasNext())
|
||||
iterator.next().update(currentKey);
|
||||
enabled = toggler != -1;
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.smart.properties.*;
|
||||
|
||||
public class SmartMovingServerConfig extends SmartMovingClientConfig
|
||||
{
|
||||
private Properties properties = new Properties();
|
||||
private Properties topProperties = new Properties();
|
||||
|
||||
public void loadFromProperties(String[] propertyArray, boolean top)
|
||||
{
|
||||
for(int i = 0; i < propertyArray.length - 1; i += 2)
|
||||
{
|
||||
String key = propertyArray[i];
|
||||
String value = propertyArray[i + 1];
|
||||
properties.put(key, value);
|
||||
if(top)
|
||||
topProperties.put(key, value);
|
||||
}
|
||||
|
||||
load(top);
|
||||
}
|
||||
|
||||
public void load(boolean top)
|
||||
{
|
||||
if(!top && !topProperties.isEmpty())
|
||||
{
|
||||
Iterator<?> iterator = topProperties.keySet().iterator();
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
Object topKey = iterator.next();
|
||||
properties.put(topKey, topProperties.get(topKey));
|
||||
}
|
||||
}
|
||||
super.loadFromProperties(properties);
|
||||
}
|
||||
|
||||
public void reset()
|
||||
{
|
||||
properties.clear();
|
||||
topProperties.clear();
|
||||
}
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.config;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
import net.smart.properties.*;
|
||||
import net.smart.properties.Properties;
|
||||
|
||||
public class SmartMovingServerOptions
|
||||
{
|
||||
public final SmartMovingConfig config;
|
||||
public final File optionsPath;
|
||||
private final Property<Map<String,String>> _userConfigKeys;
|
||||
|
||||
public SmartMovingServerOptions(SmartMovingConfig config, File optionsPath, int gameType)
|
||||
{
|
||||
this.config = config;
|
||||
this.optionsPath = optionsPath;
|
||||
|
||||
config.loadFromOptionsFile(optionsPath);
|
||||
config.saveToOptionsFile(optionsPath);
|
||||
|
||||
Property<String> configKey = null;
|
||||
Property<String[]> configKeys = null;
|
||||
switch(gameType)
|
||||
{
|
||||
default:
|
||||
case SmartMovingConfig.Survival:
|
||||
configKey = config._survivalDefaultConfigKey;
|
||||
configKeys = config._survivalConfigKeys;
|
||||
_userConfigKeys = config._survivalDefaultConfigUserKeys;
|
||||
break;
|
||||
case SmartMovingConfig.Creative:
|
||||
configKey = config._creativeDefaultConfigKey;
|
||||
configKeys = config._creativeConfigKeys;
|
||||
_userConfigKeys = config._creativeDefaultConfigUserKeys;
|
||||
break;
|
||||
case SmartMovingConfig.Adventure:
|
||||
configKey = config. _adventureDefaultConfigKey;
|
||||
configKeys = config._adventureConfigKeys;
|
||||
_userConfigKeys = config._adventureDefaultConfigUserKeys;
|
||||
break;
|
||||
}
|
||||
|
||||
config.setKeys(configKeys.value);
|
||||
config.setCurrentKey(configKey != null && !configKey.value.isEmpty() ? configKey.value : null);
|
||||
|
||||
logConfigState(config, null, false);
|
||||
}
|
||||
|
||||
public void toggle(IEntityPlayerMP player)
|
||||
{
|
||||
config.toggle();
|
||||
config.saveToOptionsFile(optionsPath);
|
||||
logConfigState(config, player.getUsername(), true);
|
||||
}
|
||||
|
||||
public void changeSpeed(int difference, IEntityPlayerMP player)
|
||||
{
|
||||
config.changeSpeed(difference);
|
||||
config.saveToOptionsFile(optionsPath);
|
||||
logSpeedState(config, player.getUsername());
|
||||
}
|
||||
|
||||
private static void logConfigState(SmartMovingConfig config, String username, boolean reconfig)
|
||||
{
|
||||
String message = "Smart Moving ";
|
||||
if(config._globalConfig.value)
|
||||
{
|
||||
if(!reconfig)
|
||||
FMLLog.info(message + "overrides client configurations");
|
||||
|
||||
String postfix = getPostfix(username);
|
||||
|
||||
if(config.enabled)
|
||||
{
|
||||
String currentKey = config.getCurrentKey();
|
||||
|
||||
message += reconfig ? "changed to " : "uses ";
|
||||
if(currentKey == null)
|
||||
FMLLog.info(message + "default server configuration" + postfix);
|
||||
else
|
||||
{
|
||||
String configName = config._configKeyName.value;
|
||||
|
||||
message += "server configuration ";
|
||||
if(configName.isEmpty())
|
||||
FMLLog.info(message + "with key \"" + currentKey + "\"" + postfix);
|
||||
else
|
||||
FMLLog.info(message + "\"" + configName + "\"" + postfix);
|
||||
}
|
||||
}
|
||||
else
|
||||
FMLLog.info(message + "disabled" + postfix);
|
||||
}
|
||||
else
|
||||
FMLLog.info(message + "allows client configurations");
|
||||
}
|
||||
|
||||
private static void logSpeedState(SmartMovingConfig config, String username)
|
||||
{
|
||||
FMLLog.info("Smart Moving speed set to " + config.getSpeedPercent() + "%" + getPostfix(username));
|
||||
}
|
||||
|
||||
private static String getPostfix(String username)
|
||||
{
|
||||
if(username == null)
|
||||
return "";
|
||||
return " by user '" + username + "'";
|
||||
}
|
||||
|
||||
public String[] writeToProperties()
|
||||
{
|
||||
return writeToProperties(null, null);
|
||||
}
|
||||
|
||||
public String[] writeToProperties(IEntityPlayerMP mp, String key)
|
||||
{
|
||||
if(key == null ? !config.enabled : key == SmartMovingProperties.Disabled)
|
||||
return new String[] { config._globalConfig.getCurrentKey(), config._globalConfig.getValueString() };
|
||||
|
||||
Properties properties = new Properties();
|
||||
config.write(properties, key);
|
||||
|
||||
String[] result = new String[properties.size() * 2];
|
||||
Iterator<Map.Entry<Object, Object>> keys = properties.entrySet().iterator();
|
||||
|
||||
String speedUserExponentKey = mp != null ? config._speedUserExponent.getCurrentKey() : null;
|
||||
int i = 0;
|
||||
while(keys.hasNext())
|
||||
{
|
||||
Map.Entry<Object, Object> entry = keys.next();
|
||||
String propertyKey = result[i++] = entry.getKey().toString();
|
||||
if(mp != null && propertyKey.equals(speedUserExponentKey))
|
||||
{
|
||||
Integer userExponent = config._speedUsersExponents.value.get(mp.getUsername());
|
||||
if(userExponent != null)
|
||||
entry.setValue(config._speedUserExponent.getValueString(userExponent));
|
||||
}
|
||||
result[i++] = entry.getValue().toString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void changeSingleSpeed(IEntityPlayerMP player, int difference)
|
||||
{
|
||||
Integer exponent = getPlayerSpeedExponent(player);
|
||||
if(exponent == null)
|
||||
exponent = config._speedUserExponent.value;
|
||||
|
||||
exponent += difference;
|
||||
setPlayerSpeedExponent(player, exponent);
|
||||
}
|
||||
|
||||
public Integer getPlayerSpeedExponent(IEntityPlayerMP player)
|
||||
{
|
||||
return config._speedUsersExponents.value.get(player.getUsername());
|
||||
}
|
||||
|
||||
public synchronized void setPlayerSpeedExponent(IEntityPlayerMP player, Integer exponent)
|
||||
{
|
||||
config._speedUsersExponents.value.put(player.getUsername(), exponent);
|
||||
config.saveToOptionsFile(optionsPath);
|
||||
}
|
||||
|
||||
public String[] writeToProperties(IEntityPlayerMP player, boolean toggle)
|
||||
{
|
||||
String key = getPlayerConfigurationKey(player);
|
||||
if(key == null || !config.hasKey(key))
|
||||
{
|
||||
key = config.getCurrentKey();
|
||||
setPlayerConfigurationKey(player, key);
|
||||
}
|
||||
|
||||
if(toggle)
|
||||
{
|
||||
key = config.getNextKey(key);
|
||||
setPlayerConfigurationKey(player, key);
|
||||
}
|
||||
|
||||
return writeToProperties(player, key);
|
||||
}
|
||||
|
||||
public String getPlayerConfigurationKey(IEntityPlayerMP player)
|
||||
{
|
||||
return _userConfigKeys.value.get(player.getUsername());
|
||||
}
|
||||
|
||||
public synchronized void setPlayerConfigurationKey(IEntityPlayerMP player, String key)
|
||||
{
|
||||
_userConfigKeys.value.put(player.getUsername(), key);
|
||||
config.saveToOptionsFile(optionsPath);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.playerapi;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.smart.moving.*;
|
||||
|
||||
public abstract class SmartMoving
|
||||
{
|
||||
public static final String SPC_ID = "Single Player Commands";
|
||||
|
||||
public static void register()
|
||||
{
|
||||
SmartMovingPlayerBase.registerPlayerBase();
|
||||
SmartMovingServerPlayerBase.registerPlayerBase();
|
||||
}
|
||||
|
||||
public static IEntityPlayerSP getPlayerBase(EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entityPlayer instanceof EntityPlayerSP)
|
||||
return SmartMovingPlayerBase.getPlayerBase((EntityPlayerSP)entityPlayer);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IEntityPlayerMP getServerPlayerBase(EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entityPlayer instanceof EntityPlayerMP)
|
||||
return SmartMovingServerPlayerBase.getPlayerBase(entityPlayer);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.playerapi;
|
||||
|
||||
import net.minecraft.entity.player.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
|
||||
public class SmartMovingFactory extends net.smart.moving.SmartMovingFactory
|
||||
{
|
||||
public static void initialize()
|
||||
{
|
||||
if(!isInitialized())
|
||||
new SmartMovingFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected net.smart.moving.SmartMoving doGetInstance(EntityPlayer entityPlayer)
|
||||
{
|
||||
net.smart.moving.SmartMoving moving = super.doGetInstance(entityPlayer);
|
||||
if(moving != null)
|
||||
return moving;
|
||||
|
||||
IEntityPlayerSP playerBase = SmartMoving.getPlayerBase(entityPlayer);
|
||||
if(playerBase != null)
|
||||
return playerBase.getMoving();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,283 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.playerapi;
|
||||
|
||||
import api.player.client.*;
|
||||
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.player.EntityPlayer.*;
|
||||
import net.minecraft.nbt.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
|
||||
public class SmartMovingPlayerBase extends ClientPlayerBase implements IEntityPlayerSP
|
||||
{
|
||||
public static void registerPlayerBase()
|
||||
{
|
||||
ClientPlayerAPI.register(SmartMovingInfo.ModName, SmartMovingPlayerBase.class);
|
||||
}
|
||||
|
||||
public static SmartMovingPlayerBase getPlayerBase(EntityPlayerSP player)
|
||||
{
|
||||
return (SmartMovingPlayerBase)((IClientPlayerAPI)player).getClientPlayerBase(SmartMovingInfo.ModName);
|
||||
}
|
||||
|
||||
public SmartMovingPlayerBase(ClientPlayerAPI playerApi)
|
||||
{
|
||||
super(playerApi);
|
||||
moving = new SmartMovingSelf(player, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeMoveEntity(double d, double d1, double d2)
|
||||
{
|
||||
moving.beforeMoveEntity(d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterMoveEntity(double d, double d1, double d2)
|
||||
{
|
||||
moving.afterMoveEntity(d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localMoveEntity(double d, double d1, double d2)
|
||||
{
|
||||
super.moveEntity(d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeSleepInBedAt(int i, int j, int k)
|
||||
{
|
||||
moving.beforeSleepInBedAt(i, j, k);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumStatus localSleepInBedAt(int i, int j, int k)
|
||||
{
|
||||
return super.sleepInBedAt(i, j, k);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float f)
|
||||
{
|
||||
return moving.getBrightness(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float localGetBrightness(float f)
|
||||
{
|
||||
return super.getBrightness(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBrightnessForRender(float f)
|
||||
{
|
||||
return moving.getBrightnessForRender(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int localGetBrightnessForRender(float f)
|
||||
{
|
||||
return super.getBrightnessForRender(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushOutOfBlocks(double d, double d1, double d2)
|
||||
{
|
||||
return moving.pushOutOfBlocks(d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeOnUpdate()
|
||||
{
|
||||
moving.beforeOnUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterOnUpdate()
|
||||
{
|
||||
moving.afterOnUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeOnLivingUpdate()
|
||||
{
|
||||
moving.beforeOnLivingUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterOnLivingUpdate()
|
||||
{
|
||||
moving.afterOnLivingUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSleepingField()
|
||||
{
|
||||
return playerAPI.getSleepingField();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsInWebField()
|
||||
{
|
||||
return playerAPI.getIsInWebField();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsInWebField(boolean newIsInWeb)
|
||||
{
|
||||
playerAPI.setIsInWebField(newIsInWeb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsJumpingField()
|
||||
{
|
||||
return playerAPI.getIsJumpingField();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Minecraft getMcField()
|
||||
{
|
||||
return playerAPI.getMcField();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveEntityWithHeading(float f, float f1)
|
||||
{
|
||||
moving.moveEntityWithHeading(f, f1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTriggerWalking()
|
||||
{
|
||||
return moving.canTriggerWalking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnLadder()
|
||||
{
|
||||
return moving.isOnLadderOrVine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmartMovingSelf getMoving()
|
||||
{
|
||||
return moving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntityActionState()
|
||||
{
|
||||
moving.updateEntityActionState(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localUpdateEntityActionState()
|
||||
{
|
||||
super.updateEntityActionState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsJumpingField(boolean flag)
|
||||
{
|
||||
playerAPI.setIsJumpingField(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMoveForwardField(float f)
|
||||
{
|
||||
player.moveForward = f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMoveStrafingField(float f)
|
||||
{
|
||||
player.moveStrafing = f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInsideOfMaterial(Material material)
|
||||
{
|
||||
return moving.isInsideOfMaterial(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean localIsInsideOfMaterial(Material material)
|
||||
{
|
||||
return super.isInsideOfMaterial(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nBTTagCompound)
|
||||
{
|
||||
moving.writeEntityToNBT(nBTTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localWriteEntityToNBT(NBTTagCompound nBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(nBTTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneaking()
|
||||
{
|
||||
return moving.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean localIsSneaking()
|
||||
{
|
||||
return super.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFOVMultiplier()
|
||||
{
|
||||
return moving.getFOVMultiplier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float localGetFOVMultiplier()
|
||||
{
|
||||
return playerAPI.localGetFOVMultiplier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeSetPositionAndRotation(double d, double d1, double d2, float f, float f1)
|
||||
{
|
||||
moving.beforeSetPositionAndRotation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeGetSleepTimer()
|
||||
{
|
||||
moving.beforeGetSleepTimer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jump()
|
||||
{
|
||||
moving.jump();
|
||||
}
|
||||
|
||||
public SmartMovingSelf moving;
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.playerapi;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import api.player.client.*;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
|
||||
import net.smart.moving.config.*;
|
||||
import net.smart.utilities.*;
|
||||
|
||||
public class SmartMovingSelf extends net.smart.moving.SmartMovingSelf
|
||||
{
|
||||
public SmartMovingSelf(EntityPlayer sp, SmartMovingPlayerBase playerBase)
|
||||
{
|
||||
super(sp, playerBase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doFlyingAnimation()
|
||||
{
|
||||
return SmartMovingOptions.hasSinglePlayerCommands && isSPCFlying(esp) || super.doFlyingAnimation();
|
||||
}
|
||||
|
||||
public static boolean isSPCFlying(EntityPlayerSP entityPlayer)
|
||||
{
|
||||
if(!SmartMovingOptions.hasSinglePlayerCommands)
|
||||
return false;
|
||||
|
||||
ClientPlayerBase spcPlayerBase = ((IClientPlayerAPI)entityPlayer).getClientPlayerBase(SmartMoving.SPC_ID);
|
||||
if(spcPlayerBase == null)
|
||||
return false;
|
||||
|
||||
if(playerHelperField == null)
|
||||
playerHelperField = Reflect.GetField(spcPlayerBase.getClass(), new Name("ph"), false);
|
||||
if(playerHelperField == null)
|
||||
return false;
|
||||
|
||||
Object playerHelper = Reflect.GetField(playerHelperField, spcPlayerBase);
|
||||
if(playerHelper == null)
|
||||
return false;
|
||||
|
||||
if(flyingField == null)
|
||||
flyingField = Reflect.GetField(playerHelper.getClass(), new Name("flying"), false);
|
||||
if(flyingField == null)
|
||||
return false;
|
||||
|
||||
Object isFlying = Reflect.GetField(flyingField, playerHelper);
|
||||
if(isFlying == null)
|
||||
return false;
|
||||
|
||||
return isFlying instanceof Boolean && (Boolean)isFlying;
|
||||
}
|
||||
|
||||
private static Field playerHelperField = null;
|
||||
private static Field flyingField = null;
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.playerapi;
|
||||
|
||||
import io.netty.buffer.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.*;
|
||||
|
||||
import api.player.server.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
import net.smart.utilities.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
public class SmartMovingServerPlayerBase extends ServerPlayerBase implements IEntityPlayerMP
|
||||
{
|
||||
public static void registerPlayerBase()
|
||||
{
|
||||
ServerPlayerAPI.register(SmartMovingInfo.ModName, SmartMovingServerPlayerBase.class);
|
||||
}
|
||||
|
||||
public static SmartMovingServerPlayerBase getPlayerBase(Object player)
|
||||
{
|
||||
return (SmartMovingServerPlayerBase)((IServerPlayerAPI)player).getServerPlayerBase(SmartMovingInfo.ModName);
|
||||
}
|
||||
|
||||
public SmartMovingServerPlayerBase(ServerPlayerAPI playerApi)
|
||||
{
|
||||
super(playerApi);
|
||||
moving = new SmartMovingServer(this, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHeight()
|
||||
{
|
||||
return player.height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMinY()
|
||||
{
|
||||
return player.boundingBox.minY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxY(double maxY)
|
||||
{
|
||||
player.boundingBox.maxY = maxY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterSetPosition(double d, double d1, double d2)
|
||||
{
|
||||
moving.afterSetPosition(d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeIsPlayerSleeping()
|
||||
{
|
||||
moving.beforeIsPlayerSleeping();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeOnUpdate()
|
||||
{
|
||||
moving.beforeOnUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterOnUpdate()
|
||||
{
|
||||
moving.afterOnUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeOnLivingUpdate()
|
||||
{
|
||||
moving.beforeOnLivingUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterOnLivingUpdate()
|
||||
{
|
||||
moving.afterOnLivingUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float doGetHealth()
|
||||
{
|
||||
return player.getHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBox()
|
||||
{
|
||||
return player.boundingBox;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB expandBox(AxisAlignedBB box, double x, double y, double z)
|
||||
{
|
||||
return box.expand(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> getEntitiesExcludingPlayer(AxisAlignedBB box)
|
||||
{
|
||||
return player.worldObj.getEntitiesWithinAABBExcludingEntity(player, box);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeadEntity(Entity entity)
|
||||
{
|
||||
return entity.isDead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCollideWithPlayer(Entity entity)
|
||||
{
|
||||
entity.onCollideWithPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEyeHeight()
|
||||
{
|
||||
return player.height - 0.18F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntityInsideOpaqueBlock()
|
||||
{
|
||||
return moving.isEntityInsideOpaqueBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean localIsEntityInsideOpaqueBlock()
|
||||
{
|
||||
return super.isEntityInsideOpaqueBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addExhaustion(float exhaustion)
|
||||
{
|
||||
moving.addExhaustion(exhaustion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localAddExhaustion(float exhaustion)
|
||||
{
|
||||
super.addExhaustion(exhaustion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMovementStat(double x, double y, double z)
|
||||
{
|
||||
moving.addMovementStat(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localAddMovementStat(double x, double y, double z)
|
||||
{
|
||||
super.addMovementStat(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localPlaySound(String soundId, float volume, float pitch)
|
||||
{
|
||||
player.playSound(soundId, volume, pitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeUpdatePotionEffects()
|
||||
{
|
||||
moving.afterAddMovingHungerBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterUpdatePotionEffects()
|
||||
{
|
||||
moving.beforeAddMovingHungerBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneaking()
|
||||
{
|
||||
return moving.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean localIsSneaking()
|
||||
{
|
||||
return playerAPI.localIsSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeight(float height)
|
||||
{
|
||||
player.height = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(byte[] data)
|
||||
{
|
||||
player.playerNetServerHandler.sendPacket(new FMLProxyPacket(Unpooled.wrappedBuffer(data), SmartMovingPacketStream.Id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername()
|
||||
{
|
||||
return player.getGameProfile().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetFallDistance()
|
||||
{
|
||||
player.fallDistance = 0;
|
||||
player.motionY = 0.08;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetTicksForFloatKick()
|
||||
{
|
||||
Reflect.SetField(net.minecraft.network.NetHandlerPlayServer.class, player.playerNetServerHandler, SmartMovingInstall.NetServerHandler_ticksForFloatKick, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacketToTrackedPlayers(FMLProxyPacket packet)
|
||||
{
|
||||
player.mcServer.worldServerForDimension(player.dimension).getEntityTracker().func_151247_a(player, packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmartMovingServer getMoving()
|
||||
{
|
||||
return moving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityPlayerMP[] getAllPlayers()
|
||||
{
|
||||
List<?> playerEntityList = player.mcServer.getConfigurationManager().playerEntityList;
|
||||
IEntityPlayerMP[] result = new IEntityPlayerMP[playerEntityList.size()];
|
||||
for(int i=0; i<playerEntityList.size(); i++)
|
||||
result[i] = (IEntityPlayerMP)((IServerPlayerAPI)playerEntityList.get(i)).getServerPlayerBase(SmartMovingInfo.ModName);
|
||||
return result;
|
||||
}
|
||||
|
||||
public final SmartMovingServer moving;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
public interface IModelPlayer
|
||||
{
|
||||
SmartMovingModel getMovingModel();
|
||||
|
||||
void superAnimateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superApplyAnimationOffsets(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void superAnimateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
|
||||
public interface IRenderPlayer
|
||||
{
|
||||
void superRenderRenderPlayer(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks);
|
||||
|
||||
void superRenderRotatePlayer(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2);
|
||||
|
||||
void superRenderRenderPlayerAt(AbstractClientPlayer entityplayer, double d, double d1, double d2);
|
||||
|
||||
void superRenderRenderName(EntityLivingBase par1EntityPlayer, double par2, double par4, double par6);
|
||||
|
||||
RenderManager getRenderManager();
|
||||
|
||||
IModelPlayer getPlayerModelBipedMain();
|
||||
|
||||
IModelPlayer getPlayerModelArmorChestplate();
|
||||
|
||||
IModelPlayer getPlayerModelArmor();
|
||||
|
||||
IModelPlayer[] getPlayerModels();
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
public class ModelPlayer extends net.smart.render.ModelPlayer implements IModelPlayer
|
||||
{
|
||||
private final SmartMovingModel model;
|
||||
|
||||
public ModelPlayer(float f)
|
||||
{
|
||||
super(f);
|
||||
|
||||
model = new SmartMovingModel(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmartMovingModel getMovingModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateHeadRotation(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateSleeping(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateArmSwinging(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateRiding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateLeftArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateRightArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateWorkingBody(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateWorkingArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateSneaking(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
model.animateBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateHeadRotation(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateSleeping(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateArmSwinging(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateRiding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateLeftArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateRightArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateWorkingBody(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateWorkingArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateSneaking(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superApplyAnimationOffsets(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.animateBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
|
||||
public class RenderPlayer extends net.smart.render.RenderPlayer implements IRenderPlayer
|
||||
{
|
||||
public RenderPlayer()
|
||||
{
|
||||
render = new SmartMovingRender(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public net.smart.render.IModelPlayer createModel(ModelBiped existing, float f)
|
||||
{
|
||||
return new ModelPlayer(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks)
|
||||
{
|
||||
render.renderPlayer(entityplayer, d, d1, d2, f, renderPartialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderPlayer(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks)
|
||||
{
|
||||
super.doRender(entityplayer, d, d1, d2, f, renderPartialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rotateCorpse(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2)
|
||||
{
|
||||
render.rotatePlayer(entityplayer, totalTime, actualRotation, f2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRotatePlayer(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2)
|
||||
{
|
||||
super.rotateCorpse(entityplayer, totalTime, actualRotation, f2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderLivingAt(AbstractClientPlayer entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
render.renderPlayerAt(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderPlayerAt(AbstractClientPlayer entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
super.renderLivingAt(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void passSpecialRender(EntityLivingBase par1EntityLiving, double par2, double par4, double par6)
|
||||
{
|
||||
render.renderName(par1EntityLiving, par2, par4, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderName(EntityLivingBase par1EntityLiving, double par2, double par4, double par6)
|
||||
{
|
||||
super.passSpecialRender(par1EntityLiving, par2, par4, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderManager getRenderManager()
|
||||
{
|
||||
return renderManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelBipedMain()
|
||||
{
|
||||
return (ModelPlayer)super.getModelBipedMain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelArmorChestplate()
|
||||
{
|
||||
return (ModelPlayer)super.getModelArmorChestplate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelArmor()
|
||||
{
|
||||
return (ModelPlayer)super.getModelArmor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer[] getPlayerModels()
|
||||
{
|
||||
if(allIModelPlayers == null)
|
||||
allIModelPlayers = new IModelPlayer[] { getPlayerModelBipedMain(), getPlayerModelArmorChestplate(), getPlayerModelArmor() };
|
||||
return allIModelPlayers;
|
||||
}
|
||||
|
||||
private IModelPlayer[] allIModelPlayers;
|
||||
|
||||
private final SmartMovingRender render;
|
||||
}
|
||||
@@ -1,798 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.smart.moving.*;
|
||||
import net.smart.render.*;
|
||||
|
||||
public class SmartMovingModel extends SmartRenderContext
|
||||
{
|
||||
public IModelPlayer imp;
|
||||
public ModelBiped mp;
|
||||
public net.smart.render.SmartRenderModel md;
|
||||
|
||||
public SmartMovingModel(net.smart.render.IModelPlayer md, IModelPlayer imp)
|
||||
{
|
||||
this.imp = imp;
|
||||
this.md = md.getRenderModel();
|
||||
this.mp = this.md.mp;
|
||||
|
||||
if(SmartMovingRender.CurrentMainModel != null)
|
||||
{
|
||||
isClimb = SmartMovingRender.CurrentMainModel.isClimb;
|
||||
isClimbJump = SmartMovingRender.CurrentMainModel.isClimbJump;
|
||||
handsClimbType = SmartMovingRender.CurrentMainModel.handsClimbType;
|
||||
feetClimbType = SmartMovingRender.CurrentMainModel.feetClimbType;
|
||||
isHandsVineClimbing = SmartMovingRender.CurrentMainModel.isHandsVineClimbing;
|
||||
isFeetVineClimbing = SmartMovingRender.CurrentMainModel.isFeetVineClimbing;
|
||||
isCeilingClimb = SmartMovingRender.CurrentMainModel.isCeilingClimb;
|
||||
isSwim = SmartMovingRender.CurrentMainModel.isSwim;
|
||||
isDive = SmartMovingRender.CurrentMainModel.isDive;
|
||||
isCrawl = SmartMovingRender.CurrentMainModel.isCrawl;
|
||||
isCrawlClimb = SmartMovingRender.CurrentMainModel.isCrawlClimb;
|
||||
isJump = SmartMovingRender.CurrentMainModel.isJump;
|
||||
isHeadJump = SmartMovingRender.CurrentMainModel.isHeadJump;
|
||||
isSlide = SmartMovingRender.CurrentMainModel.isSlide;
|
||||
isFlying = SmartMovingRender.CurrentMainModel.isFlying;
|
||||
isLevitate = SmartMovingRender.CurrentMainModel.isLevitate;
|
||||
isFalling = SmartMovingRender.CurrentMainModel.isFalling;
|
||||
isGenericSneaking = SmartMovingRender.CurrentMainModel.isGenericSneaking;
|
||||
isAngleJumping = SmartMovingRender.CurrentMainModel.isAngleJumping;
|
||||
angleJumpType = SmartMovingRender.CurrentMainModel.angleJumpType;
|
||||
isRopeSliding = SmartMovingRender.CurrentMainModel.isRopeSliding;
|
||||
|
||||
currentHorizontalSpeedFlattened = SmartMovingRender.CurrentMainModel.currentHorizontalSpeedFlattened;
|
||||
smallOverGroundHeight = SmartMovingRender.CurrentMainModel.smallOverGroundHeight;
|
||||
overGroundBlock = SmartMovingRender.CurrentMainModel.overGroundBlock;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setRotationAngles(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
final float FrequenceFactor = 0.6662F;
|
||||
|
||||
isStandard = false;
|
||||
|
||||
float currentCameraAngle = md.currentCameraAngle;
|
||||
float currentHorizontalAngle = md.currentHorizontalAngle;
|
||||
float currentVerticalAngle = md.currentVerticalAngle;
|
||||
float forwardRotation = md.forwardRotation;
|
||||
float currentVerticalSpeed = md.currentVerticalSpeed;
|
||||
float totalVerticalDistance = md.totalVerticalDistance;
|
||||
float totalDistance = md.totalDistance;
|
||||
double horizontalDistance = md.horizontalDistance;
|
||||
float currentSpeed = md.currentSpeed;
|
||||
if(!Float.isNaN(currentHorizontalSpeedFlattened))
|
||||
currentHorizontalSpeed = currentHorizontalSpeedFlattened;
|
||||
|
||||
ModelRotationRenderer bipedOuter = md.bipedOuter;
|
||||
ModelRotationRenderer bipedTorso = md.bipedTorso;
|
||||
ModelRotationRenderer bipedBody = md.bipedBody;
|
||||
ModelRotationRenderer bipedBreast = md.bipedBreast;
|
||||
ModelRotationRenderer bipedHead = md.bipedHead;
|
||||
ModelRotationRenderer bipedRightShoulder = md.bipedRightShoulder;
|
||||
ModelRotationRenderer bipedRightArm = md.bipedRightArm;
|
||||
ModelRotationRenderer bipedLeftShoulder = md.bipedLeftShoulder;
|
||||
ModelRotationRenderer bipedLeftArm = md.bipedLeftArm;
|
||||
ModelRotationRenderer bipedPelvic = md.bipedPelvic;
|
||||
ModelRotationRenderer bipedRightLeg = md.bipedRightLeg;
|
||||
ModelRotationRenderer bipedLeftLeg = md.bipedLeftLeg;
|
||||
|
||||
if(isRopeSliding)
|
||||
{
|
||||
float time = totalTime * 0.15F;
|
||||
|
||||
bipedHead.rotateAngleZ = Between(-Sixteenth, Sixteenth, Normalize(currentCameraAngle - currentHorizontalAngle));
|
||||
bipedHead.rotateAngleX = Eighth;
|
||||
bipedHead.rotationPointY = 2F;
|
||||
|
||||
bipedOuter.fadeRotateAngleY = false;
|
||||
bipedOuter.rotateAngleY = currentHorizontalAngle;
|
||||
bipedTorso.rotateAngleX = Sixteenth + Sixtyfourth * MathHelper.cos(time);
|
||||
|
||||
bipedLeftArm.rotateAngleX = bipedRightArm.rotateAngleX = Half - bipedTorso.rotateAngleX;
|
||||
|
||||
bipedRightArm.rotateAngleZ = Sixteenth + Thirtytwoth;
|
||||
bipedLeftArm.rotateAngleZ = -Sixteenth - Thirtytwoth;
|
||||
|
||||
bipedRightArm.rotationPointY = bipedLeftArm.rotationPointY = -2F;
|
||||
|
||||
bipedPelvic.rotateAngleX = bipedTorso.rotateAngleX;
|
||||
|
||||
bipedLeftLeg.rotateAngleZ = -Thirtytwoth;
|
||||
bipedRightLeg.rotateAngleZ = Thirtytwoth;
|
||||
|
||||
bipedLeftLeg.rotateAngleX = Sixtyfourth * MathHelper.cos(time + Quarter);
|
||||
bipedRightLeg.rotateAngleX = Sixtyfourth * MathHelper.cos(time - Quarter);
|
||||
}
|
||||
else if(isClimb || isCrawlClimb)
|
||||
{
|
||||
bipedOuter.rotateAngleY = forwardRotation / RadiantToAngle;
|
||||
|
||||
bipedHead.rotateAngleY = 0.0F;
|
||||
bipedHead.rotateAngleX = viewVerticalAngelOffset / RadiantToAngle;
|
||||
|
||||
bipedLeftLeg.rotationOrder = ModelRotationRenderer.YZX;
|
||||
bipedRightLeg.rotationOrder = ModelRotationRenderer.YZX;
|
||||
|
||||
float handsFrequenceUpFactor, handsDistanceUpFactor, handsDistanceUpOffset, feetFrequenceUpFactor, feetDistanceUpFactor, feetDistanceUpOffset;
|
||||
float handsFrequenceSideFactor, handsDistanceSideFactor, handsDistanceSideOffset, feetFrequenceSideFactor, feetDistanceSideFactor, feetDistanceSideOffset;
|
||||
|
||||
int handsClimbType = this.handsClimbType;
|
||||
if(isHandsVineClimbing && handsClimbType == HandsClimbing.MiddleGrab)
|
||||
handsClimbType = HandsClimbing.UpGrab;
|
||||
|
||||
float verticalSpeed = Math.min(0.5f, currentVerticalSpeed);
|
||||
float horizontalSpeed = Math.min(0.5f, currentHorizontalSpeed);
|
||||
|
||||
switch(handsClimbType)
|
||||
{
|
||||
case HandsClimbing.MiddleGrab:
|
||||
handsFrequenceSideFactor = FrequenceFactor;
|
||||
handsDistanceSideFactor = 1.0F;
|
||||
handsDistanceSideOffset = 0.0F;
|
||||
|
||||
handsFrequenceUpFactor = FrequenceFactor;
|
||||
handsDistanceUpFactor = 2F;
|
||||
handsDistanceUpOffset = -Quarter;
|
||||
break;
|
||||
case HandsClimbing.UpGrab:
|
||||
handsFrequenceSideFactor = FrequenceFactor;
|
||||
handsDistanceSideFactor = 1.0F;
|
||||
handsDistanceSideOffset = 0.0F;
|
||||
|
||||
handsFrequenceUpFactor = FrequenceFactor;
|
||||
handsDistanceUpFactor = 2F;
|
||||
handsDistanceUpOffset = -2.5F;
|
||||
break;
|
||||
default:
|
||||
handsFrequenceSideFactor = FrequenceFactor;
|
||||
handsDistanceSideFactor = 1.0F;
|
||||
handsDistanceSideOffset = 0.0F;
|
||||
|
||||
handsFrequenceUpFactor = FrequenceFactor;
|
||||
handsDistanceUpFactor = 0F;
|
||||
handsDistanceUpOffset = -0.5F;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(feetClimbType)
|
||||
{
|
||||
case HandsClimbing.UpGrab:
|
||||
feetFrequenceUpFactor = FrequenceFactor;
|
||||
feetDistanceUpFactor = 0.3F/verticalSpeed;
|
||||
feetDistanceUpOffset = -0.3F;
|
||||
|
||||
feetFrequenceSideFactor = FrequenceFactor;
|
||||
feetDistanceSideFactor = 0.5F;
|
||||
feetDistanceSideOffset = 0.0F;
|
||||
break;
|
||||
default:
|
||||
feetFrequenceUpFactor = FrequenceFactor;
|
||||
feetDistanceUpFactor = 0.0F;
|
||||
feetDistanceUpOffset = 0.0F;
|
||||
|
||||
feetFrequenceSideFactor = FrequenceFactor;
|
||||
feetDistanceSideFactor = 0.0F;
|
||||
feetDistanceSideOffset = 0.0F;
|
||||
break;
|
||||
}
|
||||
|
||||
bipedRightArm.rotateAngleX = MathHelper.cos(totalVerticalDistance * handsFrequenceUpFactor + Half) * verticalSpeed * handsDistanceUpFactor + handsDistanceUpOffset;
|
||||
bipedLeftArm.rotateAngleX = MathHelper.cos(totalVerticalDistance * handsFrequenceUpFactor) * verticalSpeed * handsDistanceUpFactor + handsDistanceUpOffset;
|
||||
|
||||
bipedRightArm.rotateAngleY = MathHelper.cos(totalHorizontalDistance * handsFrequenceSideFactor + Quarter) * horizontalSpeed * handsDistanceSideFactor + handsDistanceSideOffset;
|
||||
bipedLeftArm.rotateAngleY = MathHelper.cos(totalHorizontalDistance * handsFrequenceSideFactor) * horizontalSpeed * handsDistanceSideFactor + handsDistanceSideOffset;
|
||||
|
||||
if(isHandsVineClimbing)
|
||||
{
|
||||
bipedLeftArm.rotateAngleY *= 1F + handsFrequenceSideFactor;
|
||||
bipedRightArm.rotateAngleY *= 1F + handsFrequenceSideFactor;
|
||||
|
||||
bipedLeftArm.rotateAngleY += Eighth;
|
||||
bipedRightArm.rotateAngleY -= Eighth;
|
||||
|
||||
setArmScales(Math.abs(MathHelper.cos(bipedRightArm.rotateAngleX)), Math.abs(MathHelper.cos(bipedLeftArm.rotateAngleX)));
|
||||
}
|
||||
|
||||
if(!isFeetVineClimbing)
|
||||
{
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(totalVerticalDistance * feetFrequenceUpFactor) * feetDistanceUpFactor * verticalSpeed + feetDistanceUpOffset;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(totalVerticalDistance * feetFrequenceUpFactor + Half) * feetDistanceUpFactor * verticalSpeed + feetDistanceUpOffset;
|
||||
}
|
||||
|
||||
bipedRightLeg.rotateAngleZ = -(MathHelper.cos(totalHorizontalDistance * feetFrequenceSideFactor) - 1.0F) * horizontalSpeed * feetDistanceSideFactor + feetDistanceSideOffset;
|
||||
bipedLeftLeg.rotateAngleZ = -(MathHelper.cos(totalHorizontalDistance * feetFrequenceSideFactor + Quarter) + 1.0F) * horizontalSpeed * feetDistanceSideFactor + feetDistanceSideOffset;
|
||||
|
||||
if(isFeetVineClimbing)
|
||||
{
|
||||
float total = (MathHelper.cos(totalDistance + Half) + 1) * Thirtytwoth + Sixteenth;
|
||||
bipedRightLeg.rotateAngleX = -total;
|
||||
bipedLeftLeg.rotateAngleX = -total;
|
||||
|
||||
float difference = Math.max(0, MathHelper.cos(totalDistance - Quarter)) * Sixtyfourth;
|
||||
bipedLeftLeg.rotateAngleZ += -difference;
|
||||
bipedRightLeg.rotateAngleZ += difference;
|
||||
|
||||
setLegScales(Math.abs(MathHelper.cos(bipedRightLeg.rotateAngleX)), Math.abs(MathHelper.cos(bipedLeftLeg.rotateAngleX)));
|
||||
}
|
||||
|
||||
if(isCrawlClimb)
|
||||
{
|
||||
float height = smallOverGroundHeight + 0.25F;
|
||||
float bodyLength = 0.7F;
|
||||
float legLength = 0.55F;
|
||||
|
||||
float bodyAngleX, legAngleX, legAngleZ;
|
||||
if(height < bodyLength)
|
||||
{
|
||||
bodyAngleX = Math.max(0, (float)Math.acos(height / bodyLength));
|
||||
legAngleX = Quarter - bodyAngleX;
|
||||
legAngleZ = Thirtytwoth;
|
||||
}
|
||||
else if(height < bodyLength + legLength)
|
||||
{
|
||||
bodyAngleX = 0F;
|
||||
legAngleX = Math.max(0, (float)Math.acos((height - bodyLength) / legLength));
|
||||
legAngleZ = Thirtytwoth * (legAngleX / 1.537F);
|
||||
}
|
||||
else
|
||||
{
|
||||
bodyAngleX = 0F;
|
||||
legAngleX = 0F;
|
||||
legAngleZ = 0F;
|
||||
}
|
||||
|
||||
bipedTorso.rotateAngleX = bodyAngleX;
|
||||
|
||||
bipedRightShoulder.rotateAngleX = -bodyAngleX;
|
||||
bipedLeftShoulder.rotateAngleX = -bodyAngleX;
|
||||
|
||||
bipedHead.rotateAngleX = -bodyAngleX;
|
||||
|
||||
bipedRightLeg.rotateAngleX = legAngleX;
|
||||
bipedLeftLeg.rotateAngleX = legAngleX;
|
||||
|
||||
bipedRightLeg.rotateAngleZ = legAngleZ;
|
||||
bipedLeftLeg.rotateAngleZ = -legAngleZ;
|
||||
}
|
||||
|
||||
if(handsClimbType == HandsClimbing.NoGrab && feetClimbType != FeetClimbing.NoStep)
|
||||
{
|
||||
bipedTorso.rotateAngleX = 0.5F;
|
||||
bipedHead.rotateAngleX -= 0.5F;
|
||||
bipedPelvic.rotateAngleX -= 0.5F;
|
||||
|
||||
bipedTorso.rotationPointZ = -6.0F;
|
||||
}
|
||||
}
|
||||
else if(isClimbJump)
|
||||
{
|
||||
bipedRightArm.rotateAngleX = Half + Sixteenth;
|
||||
bipedLeftArm.rotateAngleX = Half + Sixteenth;
|
||||
|
||||
bipedRightArm.rotateAngleZ = -Thirtytwoth;
|
||||
bipedLeftArm.rotateAngleZ = Thirtytwoth;
|
||||
}
|
||||
else if(isCeilingClimb)
|
||||
{
|
||||
float distance = totalHorizontalDistance * 0.7F;
|
||||
float walkFactor = Factor(currentHorizontalSpeed, 0F, 0.12951545F);
|
||||
float standFactor = Factor(currentHorizontalSpeed, 0.12951545F, 0F);
|
||||
float horizontalAngle = horizontalDistance < 0.015F ? currentCameraAngle : currentHorizontalAngle;
|
||||
|
||||
bipedLeftArm.rotateAngleX = (MathHelper.cos(distance) * 0.52F + Half) * walkFactor + Half * standFactor;
|
||||
bipedRightArm.rotateAngleX = (MathHelper.cos(distance + Half) * 0.52F - Half) * walkFactor - Half * standFactor;
|
||||
|
||||
bipedLeftLeg.rotateAngleX = -MathHelper.cos(distance) * 0.12F * walkFactor;
|
||||
bipedRightLeg.rotateAngleX = -MathHelper.cos(distance + Half) * 0.32F * walkFactor;
|
||||
|
||||
float rotateY = MathHelper.cos(distance) * 0.44F * walkFactor;
|
||||
bipedOuter.rotateAngleY = rotateY + horizontalAngle;
|
||||
|
||||
bipedRightArm.rotateAngleY = bipedLeftArm.rotateAngleY = -rotateY;
|
||||
bipedRightLeg.rotateAngleY = bipedLeftLeg.rotateAngleY = -rotateY;
|
||||
|
||||
bipedHead.rotateAngleY = -rotateY;
|
||||
}
|
||||
else if(isSwim)
|
||||
{
|
||||
float distance = totalHorizontalDistance;
|
||||
float walkFactor = Factor(currentHorizontalSpeed, 0.15679921F, 0.52264464F);
|
||||
float sneakFactor = Math.min(Factor(currentHorizontalSpeed, 0, 0.15679921F),Factor(currentHorizontalSpeed, 0.52264464F, 0.15679921F));
|
||||
float standFactor = Factor(currentHorizontalSpeed, 0.15679921F, 0F);
|
||||
float standSneakFactor = standFactor + sneakFactor;
|
||||
float horizontalAngle = horizontalDistance < (isGenericSneaking ? 0.005 : 0.015F) ? currentCameraAngle : currentHorizontalAngle;
|
||||
|
||||
bipedHead.rotationOrder = ModelRotationRenderer.YXZ;
|
||||
bipedHead.rotateAngleY = MathHelper.cos(distance / 2.0F - Quarter) * walkFactor;
|
||||
bipedHead.rotateAngleX = -Eighth * standSneakFactor;
|
||||
bipedHead.rotationPointZ = -2F;
|
||||
|
||||
bipedOuter.fadeRotateAngleX = true;
|
||||
bipedOuter.rotateAngleX = Quarter - Sixteenth * standSneakFactor;
|
||||
bipedOuter.rotateAngleY = horizontalAngle;
|
||||
|
||||
bipedBreast.rotateAngleY = bipedBody.rotateAngleY = MathHelper.cos(distance / 2.0F - Quarter) * walkFactor;
|
||||
|
||||
bipedRightArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
bipedLeftArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
|
||||
bipedRightArm.rotateAngleZ = Quarter + Eighth + MathHelper.cos(totalTime * 0.1F) * standSneakFactor * 0.8F;
|
||||
bipedLeftArm.rotateAngleZ = -Quarter - Eighth - MathHelper.cos(totalTime * 0.1F) * standSneakFactor * 0.8F;
|
||||
|
||||
bipedRightArm.rotateAngleX = ((distance * 0.5F) % Whole - Half) * walkFactor + Sixteenth * standSneakFactor;
|
||||
bipedLeftArm.rotateAngleX = ((distance * 0.5F + Half) % Whole - Half) * walkFactor + Sixteenth * standSneakFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(distance) * 0.52264464F * walkFactor;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(distance + Half) * 0.52264464F * walkFactor;
|
||||
|
||||
float rotateFeetAngleZ = Sixteenth * standSneakFactor + MathHelper.cos(totalTime * 0.1F) * 0.4F * (standFactor - sneakFactor);
|
||||
bipedRightLeg.rotateAngleZ = rotateFeetAngleZ;
|
||||
bipedLeftLeg.rotateAngleZ = -rotateFeetAngleZ;
|
||||
|
||||
if(scaleLegType != NoScaleStart)
|
||||
setLegScales(
|
||||
1F + (MathHelper.cos(totalTime * 0.1F + Quarter) - 1F) * 0.15F * sneakFactor,
|
||||
1F + (MathHelper.cos(totalTime * 0.1F + Quarter) - 1F) * 0.15F * sneakFactor);
|
||||
|
||||
if(scaleArmType != NoScaleStart)
|
||||
setArmScales(
|
||||
1F + (MathHelper.cos(totalTime * 0.1F - Quarter) - 1F) * 0.15F * sneakFactor,
|
||||
1F + (MathHelper.cos(totalTime * 0.1F - Quarter) - 1F) * 0.15F * sneakFactor);
|
||||
}
|
||||
else if(isDive)
|
||||
{
|
||||
float distance = totalDistance * 0.7F;
|
||||
float walkFactor = Factor(currentSpeed, 0F, 0.15679921F);
|
||||
float standFactor = Factor(currentSpeed, 0.15679921F, 0F);
|
||||
float horizontalAngle = totalDistance < (isGenericSneaking ? 0.005 : 0.015F) ? currentCameraAngle : currentHorizontalAngle;
|
||||
|
||||
bipedHead.rotateAngleX = -Eighth;
|
||||
bipedHead.rotationPointZ = -2F;
|
||||
|
||||
bipedOuter.fadeRotateAngleX = true;
|
||||
bipedOuter.rotateAngleX = isLevitate ? Quarter - Sixteenth : (isJump ? 0F : Quarter - currentVerticalAngle);
|
||||
bipedOuter.rotateAngleY = horizontalAngle;
|
||||
|
||||
bipedRightLeg.rotateAngleZ = (MathHelper.cos(distance) + 1F) * 0.52264464F * walkFactor + Sixteenth * standFactor;
|
||||
bipedLeftLeg.rotateAngleZ = (MathHelper.cos(distance + Half) - 1F) * 0.52264464F * walkFactor - Sixteenth * standFactor;
|
||||
|
||||
if(scaleLegType != NoScaleStart)
|
||||
setLegScales(
|
||||
1F + (MathHelper.cos(distance - Quarter) - 1F) * 0.25F * walkFactor,
|
||||
1F + (MathHelper.cos(distance - Quarter) - 1F) * 0.25F * walkFactor);
|
||||
|
||||
bipedRightArm.rotateAngleZ = (MathHelper.cos(distance + Half) * 0.52264464F * 2.5F + Quarter) * walkFactor + (Quarter + Eighth) * standFactor;
|
||||
bipedLeftArm.rotateAngleZ = (MathHelper.cos(distance) * 0.52264464F * 2.5F - Quarter) * walkFactor - (Quarter + Eighth) * standFactor;
|
||||
|
||||
if(scaleArmType != NoScaleStart)
|
||||
setArmScales(
|
||||
1F + (MathHelper.cos(distance + Quarter) - 1F) * 0.15F * walkFactor,
|
||||
1F + (MathHelper.cos(distance + Quarter) - 1F) * 0.15F * walkFactor);
|
||||
}
|
||||
else if(isCrawl)
|
||||
{
|
||||
float distance = totalHorizontalDistance * 1.3F;
|
||||
float walkFactor = Factor(currentHorizontalSpeedFlattened, 0F, 0.12951545F);
|
||||
float standFactor = Factor(currentHorizontalSpeedFlattened, 0.12951545F, 0F);
|
||||
|
||||
bipedHead.rotateAngleZ = -viewHorizontalAngelOffset / RadiantToAngle;
|
||||
bipedHead.rotateAngleX = -Eighth;
|
||||
bipedHead.rotationPointZ = -2F;
|
||||
|
||||
bipedTorso.rotationOrder = ModelRotationRenderer.YZX;
|
||||
bipedTorso.rotateAngleX = Quarter - Thirtytwoth;
|
||||
bipedTorso.rotationPointY = 3F;
|
||||
bipedTorso.rotateAngleZ = MathHelper.cos(distance + Quarter) * Sixtyfourth * walkFactor;
|
||||
bipedBody.rotateAngleY = MathHelper.cos(distance + Half) * Sixtyfourth * walkFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleX = (MathHelper.cos(distance - Quarter) * Sixtyfourth + Thirtytwoth) * walkFactor + Thirtytwoth * standFactor;
|
||||
bipedLeftLeg.rotateAngleX = (MathHelper.cos(distance - Half - Quarter) * Sixtyfourth + Thirtytwoth) * walkFactor + Thirtytwoth * standFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleZ = (MathHelper.cos(distance - Quarter) + 1F) * 0.25F * walkFactor + Thirtytwoth * standFactor;
|
||||
bipedLeftLeg.rotateAngleZ = (MathHelper.cos(distance - Quarter) - 1F) * 0.25F * walkFactor - Thirtytwoth * standFactor;
|
||||
|
||||
if(scaleLegType != NoScaleStart)
|
||||
setLegScales(
|
||||
1F + (MathHelper.cos(distance + Quarter - Quarter) - 1F) * 0.25F * walkFactor,
|
||||
1F + (MathHelper.cos(distance - Quarter - Quarter) - 1F) * 0.25F * walkFactor);
|
||||
|
||||
bipedRightArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
bipedLeftArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
|
||||
bipedRightArm.rotateAngleX = Half + Eighth;
|
||||
bipedLeftArm.rotateAngleX = Half + Eighth;
|
||||
|
||||
bipedRightArm.rotateAngleZ = ((MathHelper.cos(distance + Half)) * Sixtyfourth + Thirtytwoth)* walkFactor + Sixteenth * standFactor;
|
||||
bipedLeftArm.rotateAngleZ = ((MathHelper.cos(distance + Half)) * Sixtyfourth - Thirtytwoth) * walkFactor - Sixteenth * standFactor;
|
||||
|
||||
bipedRightArm.rotateAngleY = -Quarter;
|
||||
bipedLeftArm.rotateAngleY = Quarter;
|
||||
|
||||
if(scaleArmType != NoScaleStart)
|
||||
setArmScales(
|
||||
1F + (MathHelper.cos(distance + Quarter) - 1F) * 0.15F * walkFactor,
|
||||
1F + (MathHelper.cos(distance - Quarter) - 1F) * 0.15F * walkFactor);
|
||||
}
|
||||
else if(isSlide)
|
||||
{
|
||||
float distance = totalHorizontalDistance * 0.7F;
|
||||
float walkFactor = Factor(currentHorizontalSpeed, 0F, 1F) * 0.8F;
|
||||
|
||||
bipedHead.rotateAngleZ = -viewHorizontalAngelOffset / RadiantToAngle;
|
||||
bipedHead.rotateAngleX = -Eighth - Sixteenth;
|
||||
bipedHead.rotationPointZ = -2F;
|
||||
|
||||
bipedOuter.fadeRotateAngleY = false;
|
||||
bipedOuter.rotateAngleY = currentHorizontalAngle;
|
||||
bipedOuter.rotationPointY = 5F;
|
||||
bipedOuter.rotateAngleX = Quarter;
|
||||
|
||||
bipedBody.rotationOrder = ModelRotationRenderer.YXZ;
|
||||
bipedBody.offsetY = -0.4F;
|
||||
bipedBody.rotationPointY = +6.5F;
|
||||
bipedBody.rotateAngleX = MathHelper.cos(distance - Eighth) * Sixtyfourth * walkFactor;
|
||||
bipedBody.rotateAngleY = MathHelper.cos(distance + Eighth) * Sixtyfourth * walkFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(distance + Half) * Sixtyfourth * walkFactor + Sixtyfourth;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(distance + Quarter) * Sixtyfourth * walkFactor + Sixtyfourth;
|
||||
|
||||
bipedRightLeg.rotateAngleZ = Thirtytwoth;
|
||||
bipedLeftLeg.rotateAngleZ = -Thirtytwoth;
|
||||
|
||||
bipedRightArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
bipedLeftArm.rotationOrder = ModelRotationRenderer.YZX;
|
||||
|
||||
bipedRightArm.rotateAngleX = MathHelper.cos(distance + Quarter) * Sixtyfourth * walkFactor + Half - Sixtyfourth;
|
||||
bipedLeftArm.rotateAngleX = MathHelper.cos(distance - Half) * Sixtyfourth * walkFactor + Half - Sixtyfourth;
|
||||
|
||||
bipedRightArm.rotateAngleZ = Sixteenth;
|
||||
bipedLeftArm.rotateAngleZ = -Sixteenth;
|
||||
|
||||
bipedRightArm.rotateAngleY = -Quarter;
|
||||
bipedLeftArm.rotateAngleY = Quarter;
|
||||
}
|
||||
else if(isFlying)
|
||||
{
|
||||
float distance = totalDistance * 0.08F;
|
||||
float walkFactor = Factor(currentSpeed, 0F, 1);
|
||||
float standFactor = Factor(currentSpeed, 1F, 0F);
|
||||
float time = totalTime * 0.15F;
|
||||
float verticalAngle = isJump ? Math.abs(currentVerticalAngle) : currentVerticalAngle;
|
||||
float horizontalAngle = horizontalDistance < 0.05F ? currentCameraAngle : currentHorizontalAngle;
|
||||
|
||||
bipedOuter.fadeRotateAngleX = true;
|
||||
bipedOuter.rotateAngleX = (Quarter - verticalAngle) * walkFactor;
|
||||
bipedOuter.rotateAngleY = horizontalAngle;
|
||||
|
||||
bipedHead.rotateAngleX = -bipedOuter.rotateAngleX / 2F;
|
||||
|
||||
bipedRightArm.rotationOrder = ModelRotationRenderer.XZY;
|
||||
bipedLeftArm.rotationOrder = ModelRotationRenderer.XZY;
|
||||
|
||||
bipedRightArm.rotateAngleY = (MathHelper.cos(time) * Sixteenth) * standFactor;
|
||||
bipedLeftArm.rotateAngleY = (MathHelper.cos(time) * Sixteenth) * standFactor;
|
||||
|
||||
bipedRightArm.rotateAngleZ = (MathHelper.cos(distance + Half) * Sixtyfourth + (Half - Sixteenth)) * walkFactor + Quarter * standFactor;
|
||||
bipedLeftArm.rotateAngleZ = (MathHelper.cos(distance) * Sixtyfourth - (Half - Sixteenth)) * walkFactor - Quarter * standFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(distance) * Sixtyfourth * walkFactor + MathHelper.cos(time + Half) * Sixtyfourth * standFactor;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(distance + Half) * Sixtyfourth * walkFactor + MathHelper.cos(time) * Sixtyfourth * standFactor;
|
||||
|
||||
bipedRightLeg.rotateAngleZ = Sixtyfourth;
|
||||
bipedLeftLeg.rotateAngleZ = -Sixtyfourth;
|
||||
}
|
||||
else if(isHeadJump)
|
||||
{
|
||||
bipedOuter.fadeRotateAngleX = true;
|
||||
bipedOuter.rotateAngleX = (Quarter - currentVerticalAngle);
|
||||
bipedOuter.rotateAngleY = currentHorizontalAngle;
|
||||
|
||||
bipedHead.rotateAngleX = -bipedOuter.rotateAngleX / 2F;
|
||||
|
||||
float bendFactor = Math.min(Factor(currentVerticalAngle, Quarter, 0), Factor(currentVerticalAngle, -Quarter, 0));
|
||||
bipedRightArm.rotateAngleX = bendFactor * -Eighth;
|
||||
bipedLeftArm.rotateAngleX = bendFactor * -Eighth;
|
||||
|
||||
bipedRightLeg.rotateAngleX = bendFactor * -Eighth;
|
||||
bipedLeftLeg.rotateAngleX = bendFactor * -Eighth;
|
||||
|
||||
float armFactorZ = Factor(currentVerticalAngle, Quarter, -Quarter);
|
||||
if(overGroundBlock != null && overGroundBlock.getMaterial().isSolid())
|
||||
armFactorZ = Math.min(armFactorZ, smallOverGroundHeight / 5F);
|
||||
|
||||
bipedRightArm.rotateAngleZ = Half - Sixteenth + armFactorZ * Eighth;
|
||||
bipedLeftArm.rotateAngleZ = Sixteenth - Half - armFactorZ * Eighth;
|
||||
|
||||
float legFactorZ = Factor(currentVerticalAngle, -Quarter, Quarter);
|
||||
bipedRightLeg.rotateAngleZ = Sixtyfourth * legFactorZ;
|
||||
bipedLeftLeg.rotateAngleZ = -Sixtyfourth * legFactorZ;
|
||||
}
|
||||
else if(isFalling)
|
||||
{
|
||||
float distance = totalDistance * 0.1F;
|
||||
|
||||
bipedRightArm.rotationOrder = ModelRotationRenderer.XZY;
|
||||
bipedLeftArm.rotationOrder = ModelRotationRenderer.XZY;
|
||||
|
||||
bipedRightArm.rotateAngleY = (MathHelper.cos(distance + Quarter) * Eighth);
|
||||
bipedLeftArm.rotateAngleY = (MathHelper.cos(distance + Quarter) * Eighth);
|
||||
|
||||
bipedRightArm.rotateAngleZ = (MathHelper.cos(distance) * Eighth + Quarter);
|
||||
bipedLeftArm.rotateAngleZ = (MathHelper.cos(distance) * Eighth - Quarter);
|
||||
|
||||
bipedRightLeg.rotateAngleX = (MathHelper.cos(distance + Half + Quarter) * Sixteenth + Thirtytwoth);
|
||||
bipedLeftLeg.rotateAngleX = (MathHelper.cos(distance + Quarter) * Sixteenth + Thirtytwoth);
|
||||
|
||||
bipedRightLeg.rotateAngleZ = (MathHelper.cos(distance) * Sixteenth + Thirtytwoth);
|
||||
bipedLeftLeg.rotateAngleZ = (MathHelper.cos(distance) * Sixteenth - Thirtytwoth);
|
||||
}
|
||||
else
|
||||
isStandard = true;
|
||||
}
|
||||
|
||||
private boolean isWorking()
|
||||
{
|
||||
return mp.onGround > 0F;
|
||||
}
|
||||
|
||||
private void animateAngleJumping()
|
||||
{
|
||||
float angle = angleJumpType * Eighth;
|
||||
md.bipedPelvic.rotateAngleY -= md.bipedOuter.rotateAngleY;
|
||||
md.bipedPelvic.rotateAngleY += md.currentCameraAngle;
|
||||
|
||||
float backness = 1F - Math.abs(angle - Half) / Quarter;
|
||||
float leftness = -Math.min(angle - Half, 0F) / Quarter;
|
||||
float rightness = Math.max(angle - Half, 0F) / Quarter;
|
||||
|
||||
md.bipedLeftLeg.rotateAngleX = Thirtytwoth * (1F + rightness);
|
||||
md.bipedRightLeg.rotateAngleX = Thirtytwoth * (1F + leftness);
|
||||
md.bipedLeftLeg.rotateAngleY = -angle;
|
||||
md.bipedRightLeg.rotateAngleY = -angle;
|
||||
md.bipedLeftLeg.rotateAngleZ = Thirtytwoth * backness;
|
||||
md.bipedRightLeg.rotateAngleZ = -Thirtytwoth * backness;
|
||||
|
||||
md.bipedLeftLeg.rotationOrder = ModelRotationRenderer.ZXY;
|
||||
md.bipedRightLeg.rotationOrder = ModelRotationRenderer.ZXY;
|
||||
|
||||
md.bipedLeftArm.rotateAngleZ = -Sixteenth * rightness;
|
||||
md.bipedRightArm.rotateAngleZ = Sixteenth * leftness;
|
||||
|
||||
md.bipedLeftArm.rotateAngleX = -Eighth * backness;
|
||||
md.bipedRightArm.rotateAngleX = -Eighth * backness;
|
||||
}
|
||||
|
||||
private void animateNonStandardWorking(float viewVerticalAngelOffset)
|
||||
{
|
||||
md.bipedRightShoulder.ignoreSuperRotation = true;
|
||||
md.bipedRightShoulder.rotateAngleX = viewVerticalAngelOffset / RadiantToAngle;
|
||||
md.bipedRightShoulder.rotateAngleY = md.workingAngle / RadiantToAngle;
|
||||
md.bipedRightShoulder.rotateAngleZ = Half;
|
||||
md.bipedRightShoulder.rotationOrder = ModelRotationRenderer.ZYX;
|
||||
md.bipedRightArm.reset();
|
||||
}
|
||||
|
||||
private void animateNonStandardBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
md.bipedRightShoulder.ignoreSuperRotation = true;
|
||||
md.bipedRightShoulder.rotateAngleY = md.workingAngle / RadiantToAngle;
|
||||
md.bipedRightShoulder.rotateAngleZ = Half;
|
||||
md.bipedRightShoulder.rotationOrder = ModelRotationRenderer.ZYX;
|
||||
|
||||
md.bipedLeftShoulder.ignoreSuperRotation = true;
|
||||
md.bipedLeftShoulder.rotateAngleY = md.workingAngle / RadiantToAngle;
|
||||
md.bipedLeftShoulder.rotateAngleZ = Half;
|
||||
md.bipedLeftShoulder.rotationOrder = ModelRotationRenderer.ZYX;
|
||||
|
||||
md.bipedRightArm.reset();
|
||||
md.bipedLeftArm.reset();
|
||||
|
||||
float headRotateAngleY = md.bipedHead.rotateAngleY;
|
||||
float outerRotateAngleY = md.bipedOuter.rotateAngleY;
|
||||
float headRotateAngleX = md.bipedHead.rotateAngleX;
|
||||
|
||||
md.bipedHead.rotateAngleY = 0;
|
||||
md.bipedOuter.rotateAngleY = 0;
|
||||
md.bipedHead.rotateAngleX = 0;
|
||||
|
||||
imp.superAnimateBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
|
||||
md.bipedHead.rotateAngleY = headRotateAngleY;
|
||||
md.bipedOuter.rotateAngleY = outerRotateAngleY;
|
||||
md.bipedHead.rotateAngleX = headRotateAngleX;
|
||||
}
|
||||
|
||||
public void animateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
setRotationAngles(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
|
||||
if(isStandard)
|
||||
imp.superAnimateHeadRotation(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateSleeping(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
if(isAngleJumping)
|
||||
animateAngleJumping();
|
||||
else
|
||||
imp.superAnimateArmSwinging(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateRiding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateLeftArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateRightArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateWorkingBody(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
else if(isWorking())
|
||||
animateNonStandardWorking(viewVerticalAngelOffset);
|
||||
}
|
||||
|
||||
public void animateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard || isWorking())
|
||||
imp.superAnimateWorkingArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard && !isAngleJumping)
|
||||
imp.superAnimateSneaking(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superApplyAnimationOffsets(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void animateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
if(isStandard)
|
||||
imp.superAnimateBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
else
|
||||
animateNonStandardBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
private void setArmScales(float rightScale, float leftScale)
|
||||
{
|
||||
if(scaleArmType == Scale)
|
||||
{
|
||||
md.bipedRightArm.scaleY = rightScale;
|
||||
md.bipedLeftArm.scaleY = leftScale;
|
||||
}
|
||||
else if(scaleArmType == NoScaleEnd)
|
||||
{
|
||||
md.bipedRightArm.offsetY -= (1F - rightScale) * 0.5F;
|
||||
md.bipedLeftArm.offsetY -= (1F - leftScale) * 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
private void setLegScales(float rightScale, float leftScale)
|
||||
{
|
||||
if(scaleLegType == Scale)
|
||||
{
|
||||
md.bipedRightLeg.scaleY = rightScale;
|
||||
md.bipedLeftLeg.scaleY = leftScale;
|
||||
}
|
||||
else if(scaleLegType == NoScaleEnd)
|
||||
{
|
||||
md.bipedRightLeg.offsetY -= (1F - rightScale) * 0.5F;
|
||||
md.bipedLeftLeg.offsetY -= (1F - leftScale) * 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
private static float Factor(float x, float x0, float x1)
|
||||
{
|
||||
if(x0 > x1)
|
||||
{
|
||||
if(x <= x1)
|
||||
return 1F;
|
||||
if(x >= x0)
|
||||
return 0F;
|
||||
return (x0 - x) / (x0 - x1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(x >= x1)
|
||||
return 1F;
|
||||
if(x <= x0)
|
||||
return 0F;
|
||||
return (x - x0) / (x1 - x0);
|
||||
}
|
||||
}
|
||||
|
||||
private static float Between(float min, float max, float value)
|
||||
{
|
||||
if(value < min)
|
||||
return min;
|
||||
if(value > max)
|
||||
return max;
|
||||
return value;
|
||||
}
|
||||
|
||||
private static float Normalize(float radiant)
|
||||
{
|
||||
while(radiant > Half)
|
||||
radiant -= Whole;
|
||||
while(radiant < -Half)
|
||||
radiant += Whole;
|
||||
return radiant;
|
||||
}
|
||||
|
||||
public boolean isStandard;
|
||||
|
||||
public boolean isClimb;
|
||||
public boolean isClimbJump;
|
||||
public int feetClimbType;
|
||||
public int handsClimbType;
|
||||
public boolean isHandsVineClimbing;
|
||||
public boolean isFeetVineClimbing;
|
||||
public boolean isCeilingClimb;
|
||||
|
||||
public boolean isSwim;
|
||||
public boolean isDive;
|
||||
public boolean isCrawl;
|
||||
public boolean isCrawlClimb;
|
||||
public boolean isJump;
|
||||
public boolean isHeadJump;
|
||||
public boolean isFlying;
|
||||
public boolean isSlide;
|
||||
public boolean isLevitate;
|
||||
public boolean isFalling;
|
||||
public boolean isGenericSneaking;
|
||||
public boolean isAngleJumping;
|
||||
public int angleJumpType;
|
||||
public boolean isRopeSliding;
|
||||
|
||||
public float currentHorizontalSpeedFlattened;
|
||||
public float smallOverGroundHeight;
|
||||
public Block overGroundBlock;
|
||||
|
||||
public int scaleArmType;
|
||||
public int scaleLegType;
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.*;
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.client.gui.*;
|
||||
import net.minecraft.client.gui.inventory.*;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
import net.smart.render.statistics.*;
|
||||
|
||||
public class SmartMovingRender extends SmartRenderContext
|
||||
{
|
||||
public static SmartMovingModel CurrentMainModel;
|
||||
|
||||
public IRenderPlayer irp;
|
||||
|
||||
public SmartMovingRender(IRenderPlayer irp)
|
||||
{
|
||||
this.irp = irp;
|
||||
|
||||
modelBipedMain = irp.getPlayerModelBipedMain().getMovingModel();
|
||||
SmartMovingModel modelArmorChestplate = irp.getPlayerModelArmorChestplate().getMovingModel();
|
||||
SmartMovingModel modelArmor = irp.getPlayerModelArmor().getMovingModel();
|
||||
|
||||
modelBipedMain.scaleArmType = Scale;
|
||||
modelBipedMain.scaleLegType = Scale;
|
||||
modelArmorChestplate.scaleArmType = NoScaleStart;
|
||||
modelArmorChestplate.scaleLegType = NoScaleEnd;
|
||||
modelArmor.scaleArmType = NoScaleStart;
|
||||
modelArmor.scaleLegType = Scale;
|
||||
}
|
||||
|
||||
public void renderPlayer(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks)
|
||||
{
|
||||
IModelPlayer[] modelPlayers = null;
|
||||
SmartMoving moving = SmartMovingFactory.getInstance(entityplayer);
|
||||
if(moving != null)
|
||||
{
|
||||
boolean isInventory = d == 0.0F && d1 == 0.0F && d2 == 0.0F && f == 0.0F && renderPartialTicks == 1.0F;
|
||||
|
||||
boolean isClimb = moving.isClimbing && !moving.isCrawling && !moving.isCrawlClimbing && !moving.isClimbJumping;
|
||||
boolean isClimbJump = moving.isClimbJumping;
|
||||
int handsClimbType = moving.actualHandsClimbType;
|
||||
int feetClimbType = moving.actualFeetClimbType;
|
||||
boolean isHandsVineClimbing = moving.isHandsVineClimbing;
|
||||
boolean isFeetVineClimbing = moving.isFeetVineClimbing;
|
||||
boolean isCeilingClimb = moving.isCeilingClimbing;
|
||||
boolean isSwim = moving.isSwimming && !moving.isDipping;
|
||||
boolean isDive = moving.isDiving;
|
||||
boolean isLevitate = moving.isLevitating;
|
||||
boolean isCrawl = moving.isCrawling && !moving.isClimbing;
|
||||
boolean isCrawlClimb = moving.isCrawlClimbing || (moving.isClimbing && moving.isCrawling);
|
||||
boolean isJump = moving.isJumping();
|
||||
boolean isHeadJump = moving.isHeadJumping;
|
||||
boolean isFlying = moving.doFlyingAnimation();
|
||||
boolean isSlide = moving.isSliding;
|
||||
boolean isFalling = moving.doFallingAnimation();
|
||||
boolean isGenericSneaking = moving.isSlow;
|
||||
boolean isAngleJumping = moving.isAngleJumping();
|
||||
int angleJumpType = moving.angleJumpType;
|
||||
boolean isRopeSliding = moving.isRopeSliding;
|
||||
|
||||
SmartStatistics statistics = SmartStatisticsFactory.getInstance(entityplayer);
|
||||
float currentHorizontalSpeedFlattened = statistics != null ? statistics.getCurrentHorizontalSpeedFlattened(renderPartialTicks, -1) : Float.NaN;
|
||||
float smallOverGroundHeight = isCrawlClimb || isHeadJump ? (float)moving.getOverGroundHeight(5D) : 0F;
|
||||
Block overGroundBlock = isHeadJump && smallOverGroundHeight < 5F ? moving.getOverGroundBlockId(smallOverGroundHeight) : null;
|
||||
|
||||
modelPlayers = irp.getPlayerModels();
|
||||
|
||||
for(int i = 0; i < modelPlayers.length; i++)
|
||||
{
|
||||
SmartMovingModel modelPlayer = modelPlayers[i].getMovingModel();
|
||||
modelPlayer.isClimb = isClimb;
|
||||
modelPlayer.isClimbJump = isClimbJump;
|
||||
modelPlayer.handsClimbType = handsClimbType;
|
||||
modelPlayer.feetClimbType = feetClimbType;
|
||||
modelPlayer.isHandsVineClimbing = isHandsVineClimbing;
|
||||
modelPlayer.isFeetVineClimbing = isFeetVineClimbing;
|
||||
modelPlayer.isCeilingClimb = isCeilingClimb;
|
||||
modelPlayer.isSwim = isSwim;
|
||||
modelPlayer.isDive = isDive;
|
||||
modelPlayer.isCrawl = isCrawl;
|
||||
modelPlayer.isCrawlClimb = isCrawlClimb;
|
||||
modelPlayer.isJump = isJump;
|
||||
modelPlayer.isHeadJump = isHeadJump;
|
||||
modelPlayer.isSlide = isSlide;
|
||||
modelPlayer.isFlying = isFlying;
|
||||
modelPlayer.isLevitate = isLevitate;
|
||||
modelPlayer.isFalling = isFalling;
|
||||
modelPlayer.isGenericSneaking = isGenericSneaking;
|
||||
modelPlayer.isAngleJumping = isAngleJumping;
|
||||
modelPlayer.angleJumpType = angleJumpType;
|
||||
modelPlayer.isRopeSliding = isRopeSliding;
|
||||
|
||||
modelPlayer.currentHorizontalSpeedFlattened = currentHorizontalSpeedFlattened;
|
||||
modelPlayer.smallOverGroundHeight = smallOverGroundHeight;
|
||||
modelPlayer.overGroundBlock = overGroundBlock;
|
||||
}
|
||||
|
||||
if (!isInventory && entityplayer.isSneaking() && !(entityplayer instanceof EntityPlayerSP) && isCrawl)
|
||||
d1 += 0.125D;
|
||||
}
|
||||
|
||||
CurrentMainModel = modelBipedMain;
|
||||
irp.superRenderRenderPlayer(entityplayer, d, d1, d2, f, renderPartialTicks);
|
||||
CurrentMainModel = null;
|
||||
|
||||
if (moving != null && moving.isLevitating && modelPlayers != null)
|
||||
for(int i = 0; i < modelPlayers.length; i++)
|
||||
modelPlayers[i].getMovingModel().md.currentHorizontalAngle = modelPlayers[i].getMovingModel().md.currentCameraAngle;
|
||||
}
|
||||
|
||||
public void rotatePlayer(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2)
|
||||
{
|
||||
SmartMoving moving = SmartMovingFactory.getInstance(entityplayer);
|
||||
if(moving != null)
|
||||
{
|
||||
boolean isInventory = f2 == 1.0F && moving.isp != null && moving.isp.getMcField().currentScreen instanceof GuiInventory;
|
||||
if(!isInventory)
|
||||
{
|
||||
float forwardRotation = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f2;
|
||||
|
||||
if(moving.isClimbing || moving.isClimbCrawling || moving.isCrawlClimbing || moving.isFlying || moving.isSwimming || moving.isDiving || moving.isCeilingClimbing || moving.isHeadJumping || moving.isSliding || moving.isAngleJumping())
|
||||
entityplayer.renderYawOffset = forwardRotation;
|
||||
}
|
||||
}
|
||||
irp.superRenderRotatePlayer(entityplayer, totalTime, actualRotation, f2);
|
||||
}
|
||||
|
||||
public void renderPlayerAt(AbstractClientPlayer entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
if(entityplayer instanceof EntityOtherPlayerMP)
|
||||
{
|
||||
SmartMoving moving = SmartMovingFactory.getOtherSmartMoving(entityplayer.getEntityId());
|
||||
if(moving != null && moving.heightOffset != 0)
|
||||
d1 += moving.heightOffset;
|
||||
}
|
||||
irp.superRenderRenderPlayerAt(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
public void renderName(EntityLivingBase entityPlayer, double d, double d1, double d2)
|
||||
{
|
||||
boolean changedIsSneaking = false, originalIsSneaking = false;
|
||||
if(Minecraft.isGuiEnabled() && entityPlayer != irp.getRenderManager().livingPlayer)
|
||||
{
|
||||
SmartMoving moving = entityPlayer instanceof EntityPlayer ? SmartMovingFactory.getInstance((EntityPlayer)entityPlayer) : null;
|
||||
if(moving != null)
|
||||
{
|
||||
originalIsSneaking = entityPlayer.isSneaking();
|
||||
boolean temporaryIsSneaking = originalIsSneaking;
|
||||
if(moving.isCrawling && !moving.isClimbing)
|
||||
temporaryIsSneaking = !Config._crawlNameTag.value;
|
||||
else if(originalIsSneaking)
|
||||
temporaryIsSneaking = !Config._sneakNameTag.value;
|
||||
|
||||
changedIsSneaking = temporaryIsSneaking != originalIsSneaking;
|
||||
if(changedIsSneaking)
|
||||
entityPlayer.setSneaking(temporaryIsSneaking);
|
||||
|
||||
if(moving.heightOffset == -1)
|
||||
d1 -= 0.2F;
|
||||
else if(originalIsSneaking && !temporaryIsSneaking)
|
||||
d1 -= 0.05F;
|
||||
}
|
||||
}
|
||||
|
||||
irp.superRenderRenderName(entityPlayer, d, d1, d2);
|
||||
|
||||
if(changedIsSneaking)
|
||||
entityPlayer.setSneaking(originalIsSneaking);
|
||||
}
|
||||
|
||||
public static void renderGuiIngame(Minecraft minecraft)
|
||||
{
|
||||
if (!Client.getNativeUserInterfaceDrawing())
|
||||
return;
|
||||
|
||||
if(!GL11.glGetBoolean(GL11.GL_ALPHA_TEST))
|
||||
return;
|
||||
|
||||
SmartMovingSelf moving = (SmartMovingSelf)SmartMovingFactory.getInstance(minecraft.thePlayer);
|
||||
if(moving != null && Config.enabled && (Options._displayExhaustionBar.value || Options._displayJumpChargeBar.value))
|
||||
{
|
||||
ScaledResolution scaledresolution = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
|
||||
int width = scaledresolution.getScaledWidth();
|
||||
int height = scaledresolution.getScaledHeight();
|
||||
|
||||
if(minecraft.playerController.shouldDrawHUD())
|
||||
{
|
||||
float maxExhaustion = Client.getMaximumExhaustion();
|
||||
float exhaustion = Math.min(moving.exhaustion, maxExhaustion);
|
||||
boolean drawExhaustion = exhaustion > 0 && exhaustion <= maxExhaustion;
|
||||
|
||||
float maxStillJumpCharge = Config._jumpChargeMaximum.value;
|
||||
float stillJumpCharge = Math.min(moving.jumpCharge, maxStillJumpCharge);
|
||||
|
||||
float maxRunJumpCharge = Config._headJumpChargeMaximum.value;
|
||||
float runJumpCharge = Math.min(moving.headJumpCharge, maxRunJumpCharge);
|
||||
|
||||
boolean drawJumpCharge = stillJumpCharge > 0 || runJumpCharge > 0;
|
||||
float maxJumpCharge = stillJumpCharge > runJumpCharge ? maxStillJumpCharge : maxRunJumpCharge;
|
||||
float jumpCharge = Math.max(stillJumpCharge, runJumpCharge);
|
||||
|
||||
if(drawExhaustion || drawJumpCharge)
|
||||
{
|
||||
GL11.glPushAttrib(GL11.GL_TEXTURE_BIT);
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation("smartmoving", "gui/icons.png"));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
_minecraft = minecraft;
|
||||
}
|
||||
|
||||
if(drawExhaustion)
|
||||
{
|
||||
float maxExhaustionForAction = Math.min(moving.maxExhaustionForAction, maxExhaustion);
|
||||
float maxExhaustionToStartAction = Math.min(moving.maxExhaustionToStartAction, maxExhaustion);
|
||||
|
||||
float fitness = maxExhaustion - exhaustion;
|
||||
float minFitnessForAction = Float.isNaN(maxExhaustionForAction) ? 0 : maxExhaustion - maxExhaustionForAction;
|
||||
float minFitnessToStartAction = Float.isNaN(maxExhaustionToStartAction) ? 0 : maxExhaustion - maxExhaustionToStartAction;
|
||||
|
||||
float maxFitnessDrawn = Math.max(Math.max(minFitnessToStartAction, fitness), minFitnessForAction);
|
||||
|
||||
int halfs = (int)Math.floor(maxFitnessDrawn / maxExhaustion * 21F);
|
||||
int fulls = halfs / 2;
|
||||
int half = halfs % 2;
|
||||
|
||||
int fitnessHalfs = (int)Math.floor(fitness / maxExhaustion * 21F);
|
||||
int fitnessFulls = fitnessHalfs / 2;
|
||||
int fitnessHalf = fitnessHalfs % 2;
|
||||
|
||||
int minFitnessForActionHalfs = (int)Math.floor(minFitnessForAction / maxExhaustion * 21F);
|
||||
int minFitnessForActionFulls = minFitnessForActionHalfs / 2;
|
||||
int minFitnessForActionHalf = minFitnessForActionHalfs % 2;
|
||||
|
||||
int minFitnessToStartActionHalfs = (int)Math.floor(minFitnessToStartAction / maxExhaustion * 21F);
|
||||
int minFitnessToStartActionFulls = minFitnessToStartActionHalfs / 2;
|
||||
|
||||
_jOffset = height - 39 - 10 - (minecraft.thePlayer.isInsideOfMaterial(Material.water) ? 10 : 0);
|
||||
for(int i = 0; i < Math.min(fulls + half, 10); i++)
|
||||
{
|
||||
_iOffset = (width / 2 + 90) - (i + 1) * 8;
|
||||
if(i < fitnessFulls)
|
||||
{
|
||||
if(i < minFitnessForActionFulls)
|
||||
drawIcon(2, 2);
|
||||
else if(i == minFitnessForActionFulls && minFitnessForActionHalf > 0)
|
||||
drawIcon(3, 2);
|
||||
else
|
||||
drawIcon(0, 0);
|
||||
}
|
||||
else if(i == fitnessFulls && fitnessHalf > 0)
|
||||
{
|
||||
if(i < minFitnessForActionFulls)
|
||||
drawIcon(1, 2);
|
||||
else if(i == minFitnessForActionFulls && minFitnessForActionHalf > 0)
|
||||
if(i < minFitnessToStartActionFulls)
|
||||
drawIcon(3, 1);
|
||||
else
|
||||
drawIcon(4, 2);
|
||||
else
|
||||
if(i < minFitnessToStartActionFulls)
|
||||
drawIcon(1, 1);
|
||||
else
|
||||
drawIcon(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(i < minFitnessForActionFulls)
|
||||
drawIcon(0, 2);
|
||||
else if(i == minFitnessForActionFulls && minFitnessForActionHalf > 0)
|
||||
if(i < minFitnessToStartActionFulls)
|
||||
drawIcon(2, 1);
|
||||
else
|
||||
drawIcon(5, 2);
|
||||
else
|
||||
if(i < minFitnessToStartActionFulls)
|
||||
drawIcon(0, 1);
|
||||
else
|
||||
drawIcon(4, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(drawJumpCharge)
|
||||
{
|
||||
boolean max = jumpCharge == maxJumpCharge;
|
||||
int fulls = max ? 10 : (int)Math.ceil(((jumpCharge - 2) * 10D) / maxJumpCharge);
|
||||
int half = max ? 0 : (int)Math.ceil((jumpCharge * 10D) / maxJumpCharge) - fulls;
|
||||
|
||||
_jOffset = height - 39 - 10 - (minecraft.thePlayer.getTotalArmorValue() > 0 ? 10 : 0);
|
||||
for(int i = 0; i < fulls + half; i++)
|
||||
{
|
||||
_iOffset = (width / 2 - 91) + i * 8;
|
||||
drawIcon(i < fulls ? 2 : 3, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(drawExhaustion || drawJumpCharge)
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void drawIcon(int x, int y)
|
||||
{
|
||||
_minecraft.ingameGUI.drawTexturedModalRect(_iOffset, _jOffset, x * 9, y * 9, 9, 9);
|
||||
}
|
||||
|
||||
public final SmartMovingModel modelBipedMain;
|
||||
|
||||
private static int _iOffset, _jOffset;
|
||||
private static Minecraft _minecraft;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render;
|
||||
|
||||
import net.smart.moving.*;
|
||||
|
||||
public abstract class SmartRenderContext extends SmartMovingContext
|
||||
{
|
||||
public static final int Scale = 0;
|
||||
public static final int NoScaleStart = 1;
|
||||
public static final int NoScaleEnd = 2;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render.playerapi;
|
||||
|
||||
import api.player.model.*;
|
||||
import api.player.render.*;
|
||||
|
||||
import net.smart.moving.*;
|
||||
import net.smart.render.playerapi.*;
|
||||
|
||||
public abstract class SmartMoving
|
||||
{
|
||||
public static final String ID = SmartMovingInfo.ModName;
|
||||
|
||||
public static void register()
|
||||
{
|
||||
String[] inferiors = new String[] { SmartRender.ID };
|
||||
|
||||
RenderPlayerBaseSorting renderSorting = new RenderPlayerBaseSorting();
|
||||
renderSorting.setAfterLocalConstructingInferiors(inferiors);
|
||||
renderSorting.setOverrideRenderPlayerInferiors(inferiors);
|
||||
renderSorting.setOverrideRotatePlayerInferiors(inferiors);
|
||||
renderSorting.setOverrideRenderPlayerSleepInferiors(inferiors);
|
||||
RenderPlayerAPI.register(ID, SmartMovingRenderPlayerBase.class, renderSorting);
|
||||
|
||||
ModelPlayerBaseSorting modelSorting = new ModelPlayerBaseSorting();
|
||||
modelSorting.setAfterLocalConstructingInferiors(inferiors);
|
||||
ModelPlayerAPI.register(ID, SmartMovingModelPlayerBase.class, modelSorting);
|
||||
}
|
||||
|
||||
public static SmartMovingRenderPlayerBase getPlayerBase(net.minecraft.client.renderer.entity.RenderPlayer renderPlayer)
|
||||
{
|
||||
return (SmartMovingRenderPlayerBase)((IRenderPlayerAPI)renderPlayer).getRenderPlayerBase(ID);
|
||||
}
|
||||
|
||||
public static SmartMovingModelPlayerBase getPlayerBase(api.player.model.ModelPlayer modelPlayer)
|
||||
{
|
||||
return (SmartMovingModelPlayerBase)((IModelPlayerAPI)modelPlayer).getModelPlayerBase(ID);
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render.playerapi;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
|
||||
import api.player.model.*;
|
||||
|
||||
import net.smart.moving.render.*;
|
||||
import net.smart.moving.render.IModelPlayer;
|
||||
import net.smart.render.playerapi.*;
|
||||
|
||||
public class SmartMovingModelPlayerBase extends ModelPlayerBase implements IModelPlayer
|
||||
{
|
||||
private SmartMovingModel model;
|
||||
|
||||
public SmartMovingModelPlayerBase(ModelPlayerAPI modelplayerapi)
|
||||
{
|
||||
super(modelplayerapi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmartMovingModel getMovingModel()
|
||||
{
|
||||
if(model == null)
|
||||
model = new SmartMovingModel(SmartRender.getPlayerBase(modelPlayer), this);
|
||||
return model;
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateHeadRotation(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateSleeping(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateArmSwinging(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateRiding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateLeftArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateRightArmItemHolding(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateWorkingBody(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateWorkingArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateSneaking(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateArms(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
public void dynamicOverrideAnimateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
getMovingModel().animateBowAiming(totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateHeadRotation", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateSleeping", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateArmSwinging", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateRiding", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateLeftArmItemHolding", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateRightArmItemHolding", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateWorkingBody", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateWorkingArms", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateSneaking", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superApplyAnimationOffsets(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateArms", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superAnimateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor)
|
||||
{
|
||||
super.dynamic("animateBowAiming", new Object[] { totalHorizontalDistance, currentHorizontalSpeed, totalTime, viewHorizontalAngelOffset, viewVerticalAngelOffset, factor });
|
||||
}
|
||||
|
||||
@Deprecated public ModelRenderer getOuter() { return getMovingModel().md.bipedOuter; }
|
||||
@Deprecated public ModelRenderer getTorso() { return getMovingModel().md.bipedTorso; }
|
||||
@Deprecated public ModelRenderer getBody() { return getMovingModel().md.bipedBody; }
|
||||
@Deprecated public ModelRenderer getBreast() { return getMovingModel().md.bipedBreast; }
|
||||
@Deprecated public ModelRenderer getNeck() { return getMovingModel().md.bipedNeck; }
|
||||
@Deprecated public ModelRenderer getHead() { return getMovingModel().md.bipedHead; }
|
||||
@Deprecated public ModelRenderer getHeadwear() { return getMovingModel().md.bipedHeadwear; }
|
||||
@Deprecated public ModelRenderer getRightShoulder() { return getMovingModel().md.bipedRightShoulder; }
|
||||
@Deprecated public ModelRenderer getRightArm() { return getMovingModel().md.bipedRightArm; }
|
||||
@Deprecated public ModelRenderer getLeftShoulder() { return getMovingModel().md.bipedLeftShoulder; }
|
||||
@Deprecated public ModelRenderer getLeftArm() { return getMovingModel().md.bipedLeftArm; }
|
||||
@Deprecated public ModelRenderer getPelvic() { return getMovingModel().md.bipedPelvic; }
|
||||
@Deprecated public ModelRenderer getRightLeg() { return getMovingModel().md.bipedRightLeg; }
|
||||
@Deprecated public ModelRenderer getLeftLeg() { return getMovingModel().md.bipedLeftLeg; }
|
||||
@Deprecated public ModelRenderer getEars() { return getMovingModel().md.bipedEars; }
|
||||
@Deprecated public ModelRenderer getCloak() { return getMovingModel().md.bipedCloak; }
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.moving.render.playerapi;
|
||||
|
||||
import net.minecraft.client.entity.*;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.entity.*;
|
||||
|
||||
import api.player.render.*;
|
||||
|
||||
import net.smart.moving.render.*;
|
||||
import net.smart.moving.render.IRenderPlayer;
|
||||
|
||||
public class SmartMovingRenderPlayerBase extends RenderPlayerBase implements IRenderPlayer
|
||||
{
|
||||
public SmartMovingRenderPlayerBase(RenderPlayerAPI renderPlayerAPI)
|
||||
{
|
||||
super(renderPlayerAPI);
|
||||
}
|
||||
|
||||
public SmartMovingRender getRenderModel()
|
||||
{
|
||||
if(render == null)
|
||||
render = new SmartMovingRender(this);
|
||||
return render;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderPlayer(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks)
|
||||
{
|
||||
getRenderModel().renderPlayer(entityplayer, d, d1, d2, f, renderPartialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderPlayer(AbstractClientPlayer entityplayer, double d, double d1, double d2, float f, float renderPartialTicks)
|
||||
{
|
||||
super.renderPlayer(entityplayer, d, d1, d2, f, renderPartialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotatePlayer(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2)
|
||||
{
|
||||
getRenderModel().rotatePlayer(entityplayer, totalTime, actualRotation, f2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRotatePlayer(AbstractClientPlayer entityplayer, float totalTime, float actualRotation, float f2)
|
||||
{
|
||||
super.rotatePlayer(entityplayer, totalTime, actualRotation, f2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderPlayerSleep(AbstractClientPlayer entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
getRenderModel().renderPlayerAt(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderPlayerAt(AbstractClientPlayer entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
super.renderPlayerSleep(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void passSpecialRender(EntityLivingBase entityliving, double d, double d1, double d2)
|
||||
{
|
||||
getRenderModel().renderName(entityliving, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void superRenderRenderName(EntityLivingBase entityplayer, double d, double d1, double d2)
|
||||
{
|
||||
super.passSpecialRender(entityplayer, d, d1, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderManager getRenderManager()
|
||||
{
|
||||
return renderPlayerAPI.getRenderManagerField();
|
||||
}
|
||||
|
||||
public boolean isRenderedWithBodyTopAlwaysInAccelerateDirection()
|
||||
{
|
||||
SmartMovingRender render = getRenderModel();
|
||||
return render.modelBipedMain.isFlying || render.modelBipedMain.isSwim || render.modelBipedMain.isDive || render.modelBipedMain.isHeadJump;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelArmor()
|
||||
{
|
||||
return SmartMoving.getPlayerBase((api.player.model.ModelPlayer)renderPlayerAPI.getModelArmorField());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelArmorChestplate()
|
||||
{
|
||||
return SmartMoving.getPlayerBase((api.player.model.ModelPlayer)renderPlayerAPI.getModelArmorChestplateField());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer getPlayerModelBipedMain()
|
||||
{
|
||||
return SmartMoving.getPlayerBase((api.player.model.ModelPlayer)renderPlayerAPI.getModelBipedMainField());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelPlayer[] getPlayerModels()
|
||||
{
|
||||
api.player.model.ModelPlayer[] modelPlayers = api.player.model.ModelPlayerAPI.getAllInstances();
|
||||
if(allModelPlayers != null && (allModelPlayers == modelPlayers || modelPlayers.length == 0 && allModelPlayers.length == 0))
|
||||
return allIModelPlayers;
|
||||
|
||||
allModelPlayers = modelPlayers;
|
||||
allIModelPlayers = new IModelPlayer[modelPlayers.length];
|
||||
for(int i=0; i<allIModelPlayers.length; i++)
|
||||
allIModelPlayers[i] = SmartMoving.getPlayerBase(allModelPlayers[i]);
|
||||
return allIModelPlayers;
|
||||
}
|
||||
|
||||
private api.player.model.ModelPlayer[] allModelPlayers;
|
||||
private IModelPlayer[] allIModelPlayers;
|
||||
|
||||
private SmartMovingRender render;
|
||||
}
|
||||
@@ -1,404 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.properties;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.smart.utilities.*;
|
||||
|
||||
public class Properties extends java.util.Properties
|
||||
{
|
||||
private static final long serialVersionUID = 5319578641402091067L;
|
||||
|
||||
private static int i = 0;
|
||||
public static final int Boolean = i++;
|
||||
public static final int Unmodified = i++;
|
||||
public static final int Modified = i++;
|
||||
public static final int Float = i++;
|
||||
public static final int Positive = i++;
|
||||
public static final int Negative = i++;
|
||||
public static final int PositiveFactor = i++;
|
||||
public static final int NegativeFactor = i++;
|
||||
public static final int IncreasingFactor = i++;
|
||||
public static final int DecreasingFactor = i++;
|
||||
public static final int Integer = i++;
|
||||
public static final int String = i++;
|
||||
public static final int Strings = i++;
|
||||
public static final int Operator = i++;
|
||||
public static final int Constant = i++;
|
||||
public static final int Key = i++;
|
||||
public static final int StringMap = i++;
|
||||
public static final int IntegerMap = i++;
|
||||
|
||||
public final String version;
|
||||
|
||||
public Properties()
|
||||
{
|
||||
version = null;
|
||||
}
|
||||
|
||||
public Properties(File file)
|
||||
{
|
||||
load(file);
|
||||
version = getProperty("move.options.version");
|
||||
}
|
||||
|
||||
public Properties(String version, File file)
|
||||
{
|
||||
load(file);
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
protected List<Property<?>> getProperties()
|
||||
{
|
||||
return getProperties(null);
|
||||
}
|
||||
|
||||
protected List<Property<?>> getProperties(Class<?> type)
|
||||
{
|
||||
List<Property<?>> properties = new ArrayList<Property<?>>();
|
||||
if(type != null)
|
||||
return addProperties(properties, type, false);
|
||||
return addProperties(properties, getClass(), true);
|
||||
}
|
||||
|
||||
private List<Property<?>> addProperties(List<Property<?>> list, Class<?> type, boolean base)
|
||||
{
|
||||
if(base && type.getSuperclass() != null)
|
||||
addProperties(list, type.getSuperclass(), base);
|
||||
|
||||
Field[] fields = type.getDeclaredFields();
|
||||
for(int i = 0; i < fields.length; i++)
|
||||
{
|
||||
fields[i].setAccessible(true);
|
||||
Object value = Reflect.GetField(fields[i], this);
|
||||
addProperties(list, value);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void addProperties(List<Property<?>> list, Object value)
|
||||
{
|
||||
if(value instanceof Property)
|
||||
list.add((Property<?>)value);
|
||||
else if(value instanceof Collection)
|
||||
{
|
||||
Iterator<?> iterator = ((Collection<?>)value).iterator();
|
||||
while(iterator.hasNext())
|
||||
addProperties(list, iterator.next());
|
||||
}
|
||||
}
|
||||
|
||||
public void write(Properties properties)
|
||||
{
|
||||
write(properties, null);
|
||||
}
|
||||
|
||||
public void write(Properties properties, String key)
|
||||
{
|
||||
List<Property<?>> propertiesToWrite = getProperties();
|
||||
for(int i = 0; i < propertiesToWrite.size(); i++)
|
||||
{
|
||||
Property<?> property = propertiesToWrite.get(i);
|
||||
if(property.isPersistent())
|
||||
properties.put(property.getCurrentKey(), key == null ? property.getValueString() : property.getKeyValueString(key));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean load(File file)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(file.exists())
|
||||
load(new FileInputStream(file));
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getBaseType(int type)
|
||||
{
|
||||
if(type == Properties.Boolean || type == Properties.Unmodified || type == Properties.Modified)
|
||||
return Properties.Boolean;
|
||||
if(type == Properties.Float || type == Properties.Positive || type == Properties.Negative || type == Properties.PositiveFactor || type == Properties.NegativeFactor || type == Properties.IncreasingFactor || type == Properties.DecreasingFactor)
|
||||
return Properties.Float;
|
||||
if(type == Properties.Integer)
|
||||
return Properties.Integer;
|
||||
if(type == Properties.Strings)
|
||||
return Properties.Strings;
|
||||
if(type == Properties.StringMap)
|
||||
return Properties.StringMap;
|
||||
if(type == Properties.IntegerMap)
|
||||
return Properties.IntegerMap;
|
||||
return Properties.String;
|
||||
}
|
||||
|
||||
public static String getBaseTypeName(int baseType)
|
||||
{
|
||||
if(baseType == Properties.Boolean)
|
||||
return "boolean";
|
||||
if(baseType == Properties.Float)
|
||||
return "floating point";
|
||||
if(baseType == Properties.Integer)
|
||||
return "integer";
|
||||
return "string";
|
||||
}
|
||||
|
||||
public static Object getDefaultValue(int type)
|
||||
{
|
||||
if(type == Boolean)
|
||||
return false;
|
||||
if(type == Unmodified)
|
||||
return true;
|
||||
if(type == Modified)
|
||||
return false;
|
||||
|
||||
if(type == Integer)
|
||||
return 0;
|
||||
|
||||
if(type == Float)
|
||||
return 0F;
|
||||
if(type == Positive)
|
||||
return 0F;
|
||||
if(type == Negative)
|
||||
return 0F;
|
||||
if(type == PositiveFactor)
|
||||
return 1F;
|
||||
if(type == NegativeFactor)
|
||||
return 1F;
|
||||
if(type == IncreasingFactor)
|
||||
return 1F;
|
||||
if(type == DecreasingFactor)
|
||||
return 1F;
|
||||
|
||||
if(type == String)
|
||||
return "";
|
||||
if(type == Strings)
|
||||
return new String[0];
|
||||
if(type == StringMap)
|
||||
return new HashMap<String, String>();
|
||||
if(type == IntegerMap)
|
||||
return new HashMap<String, Integer>();
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object getMinimumValue(int type)
|
||||
{
|
||||
if(type == Properties.Positive)
|
||||
return 0F;
|
||||
if(type == Properties.PositiveFactor)
|
||||
return 0F;
|
||||
if(type == Properties.IncreasingFactor)
|
||||
return 1F;
|
||||
if(type == Properties.DecreasingFactor)
|
||||
return 0F;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object getMaximumValue(int type)
|
||||
{
|
||||
if(type == Properties.Negative)
|
||||
return 0F;
|
||||
if(type == Properties.NegativeFactor)
|
||||
return 0F;
|
||||
if(type == Properties.DecreasingFactor)
|
||||
return 1F;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Property<Boolean> Unmodified()
|
||||
{
|
||||
return Property(Unmodified);
|
||||
}
|
||||
|
||||
public static Property<Boolean> Unmodified(String key, String... versions)
|
||||
{
|
||||
return Unmodified().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Boolean> Modified()
|
||||
{
|
||||
return Property(Modified);
|
||||
}
|
||||
|
||||
public static Property<Boolean> Modified(String key, String... versions)
|
||||
{
|
||||
return Modified().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Integer> Integer()
|
||||
{
|
||||
return Property(Integer);
|
||||
}
|
||||
|
||||
public static Property<Integer> Integer(String key, String... versions)
|
||||
{
|
||||
return Integer().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> Float()
|
||||
{
|
||||
return Property(Float);
|
||||
}
|
||||
|
||||
public static Property<Float> Float(String key, String... versions)
|
||||
{
|
||||
return Float().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> Positive()
|
||||
{
|
||||
return Property(Positive);
|
||||
}
|
||||
|
||||
public static Property<Float> Positive(String key, String... versions)
|
||||
{
|
||||
return Positive().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> Negative()
|
||||
{
|
||||
return Property(Negative);
|
||||
}
|
||||
|
||||
public static Property<Float> Negative(String key, String... versions)
|
||||
{
|
||||
return Negative().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> PositiveFactor()
|
||||
{
|
||||
return Property(PositiveFactor);
|
||||
}
|
||||
|
||||
public static Property<Float> PositiveFactor(String key, String... versions)
|
||||
{
|
||||
return PositiveFactor().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> NegativeFactor()
|
||||
{
|
||||
return Property(NegativeFactor);
|
||||
}
|
||||
|
||||
public static Property<Float> NegativeFactor(String key, String... versions)
|
||||
{
|
||||
return NegativeFactor().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> IncreasingFactor()
|
||||
{
|
||||
return Property(IncreasingFactor);
|
||||
}
|
||||
|
||||
public static Property<Float> IncreasingFactor(String key, String... versions)
|
||||
{
|
||||
return IncreasingFactor().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Float> DecreasingFactor()
|
||||
{
|
||||
return Property(DecreasingFactor);
|
||||
}
|
||||
|
||||
public static Property<Float> DecreasingFactor(String key, String... versions)
|
||||
{
|
||||
return DecreasingFactor().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<String> String()
|
||||
{
|
||||
return Property(String);
|
||||
}
|
||||
|
||||
public static Property<String> String(String key, String... versions)
|
||||
{
|
||||
return String().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<String[]> Strings()
|
||||
{
|
||||
return Property(Strings);
|
||||
}
|
||||
|
||||
public static Property<String[]> Strings(String key, String... versions)
|
||||
{
|
||||
return Strings().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Map<String,String>> StringMap()
|
||||
{
|
||||
return Property(StringMap);
|
||||
}
|
||||
|
||||
public static Property<Map<String,String>> StringMap(String key, String... versions)
|
||||
{
|
||||
return StringMap().key(key, versions);
|
||||
}
|
||||
|
||||
public static Property<Map<String,Integer>> IntegerMap()
|
||||
{
|
||||
return Property(IntegerMap);
|
||||
}
|
||||
|
||||
public static Property<Map<String,Integer>> IntegerMap(String key, String... versions)
|
||||
{
|
||||
return IntegerMap().key(key, versions);
|
||||
}
|
||||
|
||||
private static Property Property(int type)
|
||||
{
|
||||
return new Property(type);
|
||||
}
|
||||
|
||||
public static Value<Boolean> Value(Boolean base)
|
||||
{
|
||||
return new Value<Boolean>(Boolean).put(base);
|
||||
}
|
||||
|
||||
public static Value<Float> Value(Float base)
|
||||
{
|
||||
return new Value<Float>(Float).put(base);
|
||||
}
|
||||
|
||||
public static Value<String> Value(String base)
|
||||
{
|
||||
return new Value<String>(String).put(base);
|
||||
}
|
||||
|
||||
protected static String[] concat(String left, String[] right)
|
||||
{
|
||||
return concat(new String[] { left }, right);
|
||||
}
|
||||
|
||||
protected static String[] concat(String[] left, String[] right)
|
||||
{
|
||||
String[] result = new String[left.length + right.length];
|
||||
int i = 0;
|
||||
for(; i < left.length; i++)
|
||||
result[i] = left[i];
|
||||
for(; i < result.length; i++)
|
||||
result[i] = right[i - left.length];
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,827 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.properties;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class Property<T>
|
||||
{
|
||||
private static final int printWidth = 69;
|
||||
private String comment;
|
||||
private String[] header;
|
||||
private int gap;
|
||||
|
||||
private boolean explicitlyModified;
|
||||
private boolean implicitlyModified;
|
||||
private String aquiredString;
|
||||
private boolean singular;
|
||||
|
||||
private final int type;
|
||||
private String currentVersion;
|
||||
private Map<String, Object> versionSources;
|
||||
private Map<String, Object> versionDefaults;
|
||||
|
||||
private static int i = 0;
|
||||
private static final int Is = i++;
|
||||
private static final int And = i++;
|
||||
private static final int Or = i++;
|
||||
private static final int Not = i++;
|
||||
private static final int Plus = i++;
|
||||
private static final int EitherOr = i++;
|
||||
private static final int Maximum = i++;
|
||||
private static final int Minimum = i++;
|
||||
private static final int ToKeyName = i++;
|
||||
private static final int ToKeyCode = i++;
|
||||
private static final int ToBlockConfig = i++;
|
||||
|
||||
public T value;
|
||||
private Value<T> systemValue;
|
||||
private Value<T> aquiredValue;
|
||||
|
||||
private Object minValue;
|
||||
private Object maxValue;
|
||||
|
||||
private Object local;
|
||||
|
||||
private Object left;
|
||||
private int operator;
|
||||
private Object right;
|
||||
|
||||
private List<Property<Boolean>> depends = null;
|
||||
|
||||
public Property(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
private Property(String key)
|
||||
{
|
||||
this(Properties.Key);
|
||||
set(new Value(key));
|
||||
}
|
||||
|
||||
private Property(Object left, int operator, Object right)
|
||||
{
|
||||
this(Properties.Operator);
|
||||
this.left = left;
|
||||
this.operator = operator;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
private Property(Object local, int operator, Object left, Object right)
|
||||
{
|
||||
this(Properties.Operator);
|
||||
this.local = local;
|
||||
this.operator = operator;
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public void update(String key)
|
||||
{
|
||||
value = getKeyValue(key);
|
||||
}
|
||||
|
||||
public void setValue(T value)
|
||||
{
|
||||
this.value = value;
|
||||
systemValue = new Value<T>(value);
|
||||
aquiredValue = new Value<T>(value);
|
||||
implicitlyModified = false;
|
||||
explicitlyModified = false;
|
||||
}
|
||||
|
||||
public Property<T> singular()
|
||||
{
|
||||
singular = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<Boolean> is(Object value)
|
||||
{
|
||||
return new Property<Boolean>(this, Is, value);
|
||||
}
|
||||
|
||||
public Property<Boolean> and(Object value)
|
||||
{
|
||||
return new Property<Boolean>(this, And, value);
|
||||
}
|
||||
|
||||
public Property<Boolean> or(Object value)
|
||||
{
|
||||
return new Property<Boolean>(this, Or, value);
|
||||
}
|
||||
|
||||
public Property<Boolean> andNot(Property<?> value)
|
||||
{
|
||||
return and(value.not());
|
||||
}
|
||||
|
||||
public Property<Boolean> not()
|
||||
{
|
||||
return new Property<Boolean>(this, Not, null);
|
||||
}
|
||||
|
||||
public Property<Float> plus(Object value)
|
||||
{
|
||||
return new Property<Float>(this, Plus, value);
|
||||
}
|
||||
|
||||
public Property<?> eitherOr(Object either, Object or)
|
||||
{
|
||||
return new Property<Float>(this, EitherOr, either, or);
|
||||
}
|
||||
|
||||
public Property<Float> maximum(Object value)
|
||||
{
|
||||
return new Property<Float>(this, Maximum, value);
|
||||
}
|
||||
|
||||
public Property<Float> minimum(Object value)
|
||||
{
|
||||
return new Property<Float>(this, Minimum, value);
|
||||
}
|
||||
|
||||
public Property<String> toKeyName()
|
||||
{
|
||||
return new Property<String>(this, ToKeyName, null);
|
||||
}
|
||||
|
||||
public Property<Integer> toKeyCode(Integer defaultValue)
|
||||
{
|
||||
return new Property<Integer>(this, ToKeyCode, null).defaults(defaultValue);
|
||||
}
|
||||
|
||||
public Property<Dictionary<Object, Set<Integer>>> toBlockConfig()
|
||||
{
|
||||
return new Property<Dictionary<Object, Set<Integer>>>(this, ToBlockConfig, null);
|
||||
}
|
||||
|
||||
public Property<T> depends(Property<Boolean>... conditions)
|
||||
{
|
||||
if(depends == null)
|
||||
depends = new LinkedList<Property<Boolean>>();
|
||||
|
||||
for(int i = 0; i < conditions.length; i++)
|
||||
depends.add(conditions[i]);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> values(Object defaultValue, Object minValue, Object maxValue)
|
||||
{
|
||||
return defaults(defaultValue).range(minValue, maxValue);
|
||||
}
|
||||
|
||||
public Property<T> up(Object defaultValue, Object minValue)
|
||||
{
|
||||
return defaults(defaultValue).min(minValue);
|
||||
}
|
||||
|
||||
public Property<T> down(Object defaultValue, Object maxValue)
|
||||
{
|
||||
return defaults(defaultValue).max(maxValue);
|
||||
}
|
||||
|
||||
public Property<T> range(Object minValue, Object maxValue)
|
||||
{
|
||||
return min(minValue).max(maxValue);
|
||||
}
|
||||
|
||||
public Property<T> defaults(Object defaultValue, String... versions)
|
||||
{
|
||||
versionDefaults = addVersioned(versionDefaults, defaultValue, versions);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> min(Object minValue)
|
||||
{
|
||||
this.minValue = minValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> max(Object maxValue)
|
||||
{
|
||||
this.maxValue = maxValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> key(String key, String... versions)
|
||||
{
|
||||
if(currentVersion == null)
|
||||
if(versions != null && versions.length > 0)
|
||||
currentVersion = versions[0];
|
||||
else
|
||||
currentVersion = Current;
|
||||
|
||||
return source(new Property(key), versions);
|
||||
}
|
||||
|
||||
public Property<T> source(Object source, String... versions)
|
||||
{
|
||||
versionSources = addVersioned(versionSources, source, versions);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> comment(String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> section(String... header)
|
||||
{
|
||||
gap = 1;
|
||||
this.header = header;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> chapter(String... header)
|
||||
{
|
||||
gap = 2;
|
||||
this.header = header;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Property<T> book(String... header)
|
||||
{
|
||||
gap = 3;
|
||||
this.header = header;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void reset()
|
||||
{
|
||||
explicitlyModified = false;
|
||||
implicitlyModified = false;
|
||||
|
||||
value = null;
|
||||
systemValue = null;
|
||||
aquiredValue = null;
|
||||
|
||||
reset(minValue);
|
||||
reset(maxValue);
|
||||
|
||||
reset(left);
|
||||
reset(right);
|
||||
if(depends != null)
|
||||
for(int i = 0; i < depends.size(); i++)
|
||||
reset(depends.get(i));
|
||||
}
|
||||
|
||||
private static void reset(Object value)
|
||||
{
|
||||
if(value instanceof Property)
|
||||
((Property<?>)value).reset();
|
||||
}
|
||||
|
||||
public boolean load(Properties... propertiesList)
|
||||
{
|
||||
if(systemValue != null)
|
||||
return true;
|
||||
|
||||
if(type == Properties.Constant)
|
||||
return true;
|
||||
|
||||
if(type == Properties.Operator)
|
||||
{
|
||||
if(operator == EitherOr)
|
||||
{
|
||||
if(getValue(left) == null || getValue(right) == null || getValue(local) == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(operator == Is || operator == And || operator == Or || operator == Plus || operator == Maximum || operator == Minimum)
|
||||
{
|
||||
if(getValue(left) == null || getValue(right) == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(operator == Not || operator == ToKeyName || operator == ToKeyCode || operator == ToBlockConfig)
|
||||
{
|
||||
if(getValue(left) == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
Object operatorValue = null;
|
||||
if(operator == Is)
|
||||
operatorValue = getValue(left).is(getValue(right));
|
||||
else if(operator == And)
|
||||
operatorValue = getValue(left).and(getValue(right));
|
||||
else if(operator == Or)
|
||||
operatorValue = getValue(left).or(getValue(right));
|
||||
else if(operator == Not)
|
||||
operatorValue = getValue(left).not();
|
||||
else if(operator == Plus)
|
||||
operatorValue = getValue(left).plus(getValue(right));
|
||||
else if(operator == EitherOr)
|
||||
operatorValue = getValue(local).eitherOr(getValue(left), getValue(right));
|
||||
else if(operator == Maximum)
|
||||
operatorValue = getValue(left).maximum(getValue(right));
|
||||
else if(operator == Minimum)
|
||||
operatorValue = getValue(left).minimum(getValue(right));
|
||||
else if(operator == ToKeyName)
|
||||
operatorValue = getValue(left).toKeyName();
|
||||
else if(operator == ToKeyCode)
|
||||
operatorValue = getValue(left).toKeyCode();
|
||||
else if(operator == ToBlockConfig)
|
||||
operatorValue = getValue(left).toBlockConfig();
|
||||
|
||||
if(operatorValue == null)
|
||||
throw new RuntimeException("Unknown operator '" + operator + "' found");
|
||||
|
||||
return set(getValue(operatorValue));
|
||||
}
|
||||
|
||||
if(propertiesList == null || versionSources == null)
|
||||
return false;
|
||||
|
||||
if(depends != null)
|
||||
{
|
||||
for(int i = 0; i < depends.size(); i++)
|
||||
if(getValue(depends.get(i)) == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
Object minObject = getMinimumValue();
|
||||
Value<T> minValue = getValue(minObject);
|
||||
if(minObject != null && minValue == null)
|
||||
return false;
|
||||
|
||||
Object maxObject = getMaximumValue();
|
||||
Value<T> maxValue = getValue(maxObject);
|
||||
if(maxObject != null && maxValue == null)
|
||||
return false;
|
||||
|
||||
Value<T> defaultValue = getValue(getDefaultValue());
|
||||
for(int i = 0; i < propertiesList.length; i++)
|
||||
{
|
||||
Properties properties = propertiesList[i];
|
||||
Object source = getVersionSource(properties.version);
|
||||
if(source != null)
|
||||
{
|
||||
String key = getKey(source);
|
||||
aquiredValue = key != null ? getPropertyValue(properties, key) : getValue(source);
|
||||
if(aquiredValue != null)
|
||||
{
|
||||
Value<T> initValue = aquiredValue.clone();
|
||||
if(depends != null)
|
||||
for(int n = 0; n < depends.size(); n++)
|
||||
initValue.withDependency(getValue(depends.get(n)), defaultValue);
|
||||
|
||||
if(minObject != null)
|
||||
initValue.withMinimum(minValue, defaultValue);
|
||||
|
||||
if(maxObject != null)
|
||||
initValue.withMaximum(maxValue, defaultValue);
|
||||
|
||||
return set(initValue);
|
||||
}
|
||||
else if(key == null)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return set(defaultValue);
|
||||
}
|
||||
|
||||
private boolean set(Value<T> initValue)
|
||||
{
|
||||
systemValue = initValue;
|
||||
update(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Map<String, Object> addVersioned(Map<String, Object> versioned, Object value, String... versions)
|
||||
{
|
||||
if(versioned == null)
|
||||
versioned = new Hashtable<String, Object>(1);
|
||||
|
||||
if(versions == null || versions.length == 0)
|
||||
versions = CurrentArray;
|
||||
|
||||
for(int i = 0; i < versions.length; i++)
|
||||
versioned.put(versions[i], value);
|
||||
return versioned;
|
||||
}
|
||||
|
||||
public T getKeyValue(String key)
|
||||
{
|
||||
T value = systemValue.get(key);
|
||||
if(value == null)
|
||||
value = getValue(getDefaultValue()).get(null);
|
||||
if(value == null)
|
||||
value = (T)Properties.getDefaultValue(type);
|
||||
return value;
|
||||
}
|
||||
|
||||
private Value<T> getValue(Object value)
|
||||
{
|
||||
if(value instanceof Property)
|
||||
{
|
||||
Property<?> property = (Property<?>)value;
|
||||
property.load((Properties[])null);
|
||||
return (Value<T>)property.systemValue;
|
||||
}
|
||||
if(value instanceof Value<?>)
|
||||
return (Value<T>)value;
|
||||
return new Value<T>((T)value);
|
||||
}
|
||||
|
||||
private Object getDefaultValue(String version)
|
||||
{
|
||||
Object defaultValue = null;
|
||||
if(versionDefaults != null)
|
||||
{
|
||||
if(version != null)
|
||||
defaultValue = versionDefaults.get(version);
|
||||
if(defaultValue == null)
|
||||
defaultValue = versionDefaults.get(Current);
|
||||
}
|
||||
if(defaultValue == null)
|
||||
defaultValue = Properties.getDefaultValue(type);
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
private Object getDefaultValue()
|
||||
{
|
||||
return getDefaultValue(Current);
|
||||
}
|
||||
|
||||
private Object getMinimumValue()
|
||||
{
|
||||
if(minValue != null)
|
||||
return minValue;
|
||||
return Properties.getMinimumValue(type);
|
||||
}
|
||||
|
||||
private Object getMaximumValue()
|
||||
{
|
||||
if(maxValue != null)
|
||||
return maxValue;
|
||||
return Properties.getMaximumValue(type);
|
||||
}
|
||||
|
||||
private Object getVersionSource(String version)
|
||||
{
|
||||
if(versionSources == null)
|
||||
return null;
|
||||
|
||||
Object source = null;
|
||||
if(version != null)
|
||||
source = versionSources.get(version);
|
||||
if(source == null)
|
||||
source = versionSources.get(Current);
|
||||
return source;
|
||||
}
|
||||
|
||||
private Value<T> getPropertyValue(Properties properties, String key)
|
||||
{
|
||||
String propertyString = properties.getProperty(key);
|
||||
if(propertyString != null)
|
||||
aquiredString = propertyString;
|
||||
|
||||
String stringToParse = propertyString;
|
||||
if(propertyString != null)
|
||||
{
|
||||
stringToParse = propertyString.trim();
|
||||
explicitlyModified = stringToParse.endsWith("!");
|
||||
if(explicitlyModified)
|
||||
stringToParse = stringToParse.substring(0, stringToParse.length() - 1);
|
||||
stringToParse = stringToParse.trim();
|
||||
}
|
||||
|
||||
Value<T> value = parsePropertyValue(stringToParse);
|
||||
implicitlyModified = stringToParse != null && (value == null || !value.equals(getValue(getDefaultValue(properties.version))));
|
||||
if(!explicitlyModified && !implicitlyModified)
|
||||
return getValue(getDefaultValue());
|
||||
return value;
|
||||
}
|
||||
|
||||
private Value<T> parsePropertyValue(String stringToParse)
|
||||
{
|
||||
if(stringToParse != null)
|
||||
return new Value<T>(type).load(stringToParse, singular);
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean print(PrintWriter printer, String[] sorted, String version, boolean comments)
|
||||
{
|
||||
if(!isPersistent() || systemValue == null)
|
||||
return false;
|
||||
|
||||
if(getVersionSource(version) == null)
|
||||
return false;
|
||||
|
||||
int gap = this.gap + (comment == null ? -1 : 1);
|
||||
for(int i = 0; i < gap; i++)
|
||||
printer.println();
|
||||
|
||||
if(header != null && header.length > 0)
|
||||
printHeader(printer);
|
||||
|
||||
if(comment != null && comments)
|
||||
{
|
||||
printer.print("# ");
|
||||
printer.print(comment);
|
||||
printer.println();
|
||||
}
|
||||
|
||||
if(aquiredString == null)
|
||||
{
|
||||
printValue(printer, sorted, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean error = false;
|
||||
|
||||
Iterator<String> unparsed = aquiredValue.getUnparsableStrings();
|
||||
while(unparsed != null && unparsed.hasNext())
|
||||
{
|
||||
String unparsableString = unparsed.next();
|
||||
printErrorPrefix(printer);
|
||||
printer.print("Could not interpret string \"");
|
||||
printer.print(unparsableString);
|
||||
printer.print("\" as ");
|
||||
printer.print(Properties.getBaseTypeName(Properties.getBaseType(type)));
|
||||
printer.print(" value, used ");
|
||||
printer.print(!aquiredString.isEmpty() && aquiredValue.get(null) != null ? "local" : "system");
|
||||
printer.print(" default");
|
||||
printValuePostfix(printer, null);
|
||||
printErrorPostfix(printer);
|
||||
error = true;
|
||||
}
|
||||
|
||||
Object minObject = getMinimumValue();
|
||||
Value<T> minValue = getValue(minObject);
|
||||
|
||||
Object maxObject = getMaximumValue();
|
||||
Value<T> maxValue = getValue(maxObject);
|
||||
|
||||
Iterator<String> keys = Value.GetAllKeys(systemValue);
|
||||
while(keys.hasNext())
|
||||
{
|
||||
String key = keys.next();
|
||||
|
||||
T parsedSingleValue = aquiredValue.getStored(key);
|
||||
T aquiredSingleValue = aquiredValue.get(key);
|
||||
T usedSingleValue = systemValue.getStored(key);
|
||||
|
||||
if(parsedSingleValue == null)
|
||||
if(aquiredSingleValue == null)
|
||||
continue;
|
||||
else if(aquiredSingleValue.equals(usedSingleValue))
|
||||
continue;
|
||||
else
|
||||
{
|
||||
// local default value "aquiredSingleValue" invalid for specific key
|
||||
}
|
||||
else
|
||||
{
|
||||
if(parsedSingleValue.equals(usedSingleValue))
|
||||
continue;
|
||||
// else
|
||||
// local keyed value "parsedSingleValue" invalid
|
||||
}
|
||||
|
||||
if(Properties.getBaseType(type) == Properties.Boolean && depends != null && !depends.isEmpty())
|
||||
{
|
||||
String dependKey = null;
|
||||
for(int i = 0; i < depends.size(); i++)
|
||||
{
|
||||
Property<Boolean> depend = depends.get(i);
|
||||
String currentDependKey = depend.getCurrentKey();
|
||||
if(currentDependKey != null && !depend.getKeyValue(key))
|
||||
{
|
||||
dependKey = currentDependKey;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printWarnPrefix(printer);
|
||||
printValuePrefix(printer, key);
|
||||
printer.print("is ignored because ");
|
||||
|
||||
if(dependKey != null)
|
||||
{
|
||||
printer.print("the ");
|
||||
|
||||
if(key == Value.Null)
|
||||
printer.print("default");
|
||||
else
|
||||
printer.print("\"" + key + "\"");
|
||||
|
||||
printer.print(" value of property \"");
|
||||
printer.print(dependKey);
|
||||
printer.print("\" is \"false\"");
|
||||
}
|
||||
else
|
||||
printer.print("one of the restricting expressions evaluated to \"false\"");
|
||||
|
||||
printWarnPostfix(printer);
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
printErrorPrefix(printer);
|
||||
printValuePrefix(printer, key);
|
||||
printer.print("was out of range, used ");
|
||||
|
||||
if(minValue != null && usedSingleValue.equals(minValue.get(key)))
|
||||
printer.print("minimum");
|
||||
else if(maxValue != null && usedSingleValue.equals(maxValue.get(key)))
|
||||
printer.print("maximum");
|
||||
else
|
||||
printer.print("in-range");
|
||||
|
||||
printValuePostfix(printer, key);
|
||||
printErrorPostfix(printer);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
printValue(printer, sorted, error);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void printValue(PrintWriter printer, String[] sorted, boolean error)
|
||||
{
|
||||
printer.print(getCurrentKey());
|
||||
printer.print(":");
|
||||
|
||||
if(aquiredString != null && (error || explicitlyModified))
|
||||
printer.print(aquiredString);
|
||||
else if(implicitlyModified && systemValue.equals(getValue(getDefaultValue())))
|
||||
{
|
||||
printer.print(aquiredString);
|
||||
printer.print("!");
|
||||
}
|
||||
else
|
||||
systemValue.print(printer, sorted);
|
||||
}
|
||||
|
||||
private void printHeader(PrintWriter printer)
|
||||
{
|
||||
String title = header[0];
|
||||
String body = header.length > 1 ? header[1] : null;
|
||||
char separator = gap == 3 ? '=' : (gap == 2 ? '-' : ' ');
|
||||
printSeparation(printer, separator, printWidth);
|
||||
printer.print("# ");
|
||||
printer.println(title);
|
||||
if(body != null)
|
||||
{
|
||||
printSeparation(printer, '-', title.length());
|
||||
int lineWidth = printWidth - 2;
|
||||
while(true)
|
||||
{
|
||||
printer.print("# ");
|
||||
if(body.length() <= lineWidth)
|
||||
{
|
||||
printer.println(body);
|
||||
break;
|
||||
}
|
||||
|
||||
int i;
|
||||
for(i = lineWidth; i > 0; i--)
|
||||
if(body.charAt(i) == ' ')
|
||||
break;
|
||||
|
||||
printer.println(body.substring(0, i));
|
||||
body = body.substring(i + 1);
|
||||
}
|
||||
}
|
||||
printSeparation(printer, separator, printWidth);
|
||||
printer.println();
|
||||
}
|
||||
|
||||
private static void printSeparation(PrintWriter printer, char seperator, int length)
|
||||
{
|
||||
printer.print("# ");
|
||||
for(int i = 0; i < length; i++)
|
||||
printer.print(seperator);
|
||||
printer.println();
|
||||
}
|
||||
|
||||
private void printValuePrefix(PrintWriter printer, String key)
|
||||
{
|
||||
printer.print("Interpreted ");
|
||||
|
||||
if(key != Value.Null)
|
||||
{
|
||||
printer.print("\"");
|
||||
printer.print(key);
|
||||
printer.print("\" ");
|
||||
}
|
||||
|
||||
printer.print("value \"");
|
||||
printer.print(aquiredValue.get(key));
|
||||
printer.print("\" ");
|
||||
}
|
||||
|
||||
private void printValuePostfix(PrintWriter printer, String key)
|
||||
{
|
||||
printer.print(" value \"");
|
||||
printer.print(aquiredString == null || aquiredString.isEmpty() ? getValue(getDefaultValue()) : getKeyValue(key));
|
||||
printer.print("\" instead");
|
||||
}
|
||||
|
||||
private static void printErrorPrefix(PrintWriter printer)
|
||||
{
|
||||
printErrorPrefix(printer, false);
|
||||
}
|
||||
|
||||
private static void printWarnPrefix(PrintWriter printer)
|
||||
{
|
||||
printErrorPrefix(printer, true);
|
||||
}
|
||||
|
||||
private static void printErrorPrefix(PrintWriter printer, boolean warning)
|
||||
{
|
||||
printer.print("#");
|
||||
if(!warning)
|
||||
printer.print("!!");
|
||||
printer.print("! ");
|
||||
}
|
||||
|
||||
private static void printErrorPostfix(PrintWriter printer)
|
||||
{
|
||||
printErrorPostfix(printer, false);
|
||||
}
|
||||
|
||||
private static void printWarnPostfix(PrintWriter printer)
|
||||
{
|
||||
printErrorPostfix(printer, true);
|
||||
}
|
||||
|
||||
private static void printErrorPostfix(PrintWriter printer, boolean warning)
|
||||
{
|
||||
printer.print(" !");
|
||||
if(!warning)
|
||||
printer.print("!!");
|
||||
printer.println("#");
|
||||
}
|
||||
|
||||
public boolean isPersistent()
|
||||
{
|
||||
return versionSources != null && versionSources.size() > 0;
|
||||
}
|
||||
|
||||
public String getCurrentKey()
|
||||
{
|
||||
if(isPersistent())
|
||||
return getKey(getVersionSource(currentVersion));
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String getKey(Object candidate)
|
||||
{
|
||||
if(candidate instanceof Property)
|
||||
{
|
||||
Property<?> property = (Property<?>)candidate;
|
||||
if(property.type == Properties.Key)
|
||||
return (String)property.value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if(isPersistent())
|
||||
return getCurrentKey();
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
public String getKeyValueString(String key)
|
||||
{
|
||||
return getValueString(getKeyValue(key));
|
||||
}
|
||||
|
||||
public String getValueString()
|
||||
{
|
||||
return getValueString(value);
|
||||
}
|
||||
|
||||
public String getValueString(T value)
|
||||
{
|
||||
return value != null ? Value.createDisplayString(value) : null;
|
||||
}
|
||||
|
||||
private static final String Current = "";
|
||||
private static final String[] CurrentArray = new String[] { Current };
|
||||
}
|
||||
@@ -1,692 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Moving.
|
||||
//
|
||||
// Smart Moving is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Moving is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Moving. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.properties;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.smart.utilities.*;
|
||||
|
||||
public class Value<T>
|
||||
{
|
||||
private int type;
|
||||
|
||||
private T value;
|
||||
private Dictionary<String, T> keyValues;
|
||||
private List<String> unparsableStrings;
|
||||
|
||||
public Value(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Value(T value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Value(Value<T> value)
|
||||
{
|
||||
type = value.type;
|
||||
this.value = value.value;
|
||||
if(value.keyValues != null)
|
||||
{
|
||||
keyValues = new Hashtable<String, T>();
|
||||
Enumeration<String> keys = value.keyValues.keys();
|
||||
while(keys.hasMoreElements())
|
||||
{
|
||||
String key = keys.nextElement();
|
||||
keyValues.put(key, value.keyValues.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Value<T> put(T value)
|
||||
{
|
||||
return put(null, value);
|
||||
}
|
||||
|
||||
public T get(String key)
|
||||
{
|
||||
if(key != null && keyValues != null)
|
||||
{
|
||||
T value = keyValues.get(key);
|
||||
if(value != null)
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public T getStored(String key)
|
||||
{
|
||||
if(key == null || key == Null)
|
||||
return value;
|
||||
if(keyValues != null)
|
||||
return keyValues.get(key);
|
||||
return null;
|
||||
}
|
||||
|
||||
private T get(String key, Value<T> defaultValue)
|
||||
{
|
||||
T result = get(key);
|
||||
if(result == null)
|
||||
{
|
||||
result = value;
|
||||
if(result == null)
|
||||
result = defaultValue.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<T> put(String key, T value)
|
||||
{
|
||||
if(key == null || key == Null || key.isEmpty())
|
||||
this.value = value;
|
||||
else
|
||||
{
|
||||
if(keyValues == null)
|
||||
keyValues = new Hashtable<String, T>();
|
||||
keyValues.put(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public void withDependency(Value<T> dependency, Value<T> defaultValue)
|
||||
{
|
||||
Iterator<String> iterator = GetAllKeys(this, dependency);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
if(get(key, defaultValue).equals(true) && dependency.get(key).equals(false))
|
||||
put(key, (T)(Object)false);
|
||||
}
|
||||
}
|
||||
|
||||
public void withMinimum(Value<T> minimum, Value<T> defaultValue)
|
||||
{
|
||||
Iterator<String> iterator = GetAllKeys(this, minimum);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
put(key, (T)(Object)Math.max((Float)get(key, defaultValue), (Float)minimum.get(key)));
|
||||
}
|
||||
}
|
||||
|
||||
public void withMaximum(Value<T> maximum, Value<T> defaultValue)
|
||||
{
|
||||
Iterator<String> iterator = GetAllKeys(this, maximum);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
put(key, (T)(Object)Math.min((Float)get(key, defaultValue), (Float)maximum.get(key)));
|
||||
}
|
||||
}
|
||||
|
||||
public Value<Boolean> is(Value<T> right)
|
||||
{
|
||||
Value<Boolean> result = new Value<Boolean>(Properties.Boolean);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
T leftValue = get(key);
|
||||
T rightValue = right.get(key);
|
||||
result.put(key, leftValue == null && rightValue == null || leftValue != null && rightValue != null && leftValue.equals(rightValue));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Boolean> and(Value<T> right)
|
||||
{
|
||||
Value<Boolean> result = new Value<Boolean>(Properties.Boolean);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, ((Boolean)get(key)) && ((Boolean)right.get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Boolean> or(Value<T> right)
|
||||
{
|
||||
Value<Boolean> result = new Value<Boolean>(Properties.Boolean);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, ((Boolean)get(key)) || ((Boolean)right.get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Boolean> not()
|
||||
{
|
||||
Value<Boolean> result = new Value<Boolean>(Properties.Boolean);
|
||||
Iterator<String> iterator = GetAllKeys(this);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, !((Boolean)get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Float> plus(Value<T> right)
|
||||
{
|
||||
Value<Float> result = new Value<Float>(Properties.Float);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, ((Float)get(key)) + ((Float)right.get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<T> eitherOr(Value<T> left, Value<T> right)
|
||||
{
|
||||
Value<T> result = new Value<T>(Properties.getBaseType(left.type));
|
||||
Iterator<String> iterator = GetAllKeys(this, left, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, ((Boolean)get(key)) ? left.get(key) : right.get(key));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Float> maximum(Value<T> right)
|
||||
{
|
||||
Value<Float> result = new Value<Float>(Properties.Float);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, Math.max((Float)get(key), (Float)right.get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Float> minimum(Value<T> right)
|
||||
{
|
||||
Value<Float> result = new Value<Float>(Properties.Float);
|
||||
Iterator<String> iterator = GetAllKeys(this, right);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, Math.min((Float)get(key), (Float)right.get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<String> toKeyName()
|
||||
{
|
||||
Value<String> result = new Value<String>(Properties.String);
|
||||
Iterator<String> iterator = GetAllKeys(this);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, toKeyName((Integer)get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Integer> toKeyCode()
|
||||
{
|
||||
Value<Integer> result = new Value<Integer>(Properties.Integer);
|
||||
Iterator<String> iterator = GetAllKeys(this);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, toKeyCode((String)get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<Dictionary<Object, Set<Integer>>> toBlockConfig()
|
||||
{
|
||||
Value<Dictionary<Object, Set<Integer>>> result = new Value<Dictionary<Object, Set<Integer>>>(Properties.Strings);
|
||||
Iterator<String> iterator = GetAllKeys(this);
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
String key = iterator.next();
|
||||
result.put(key, toBlockConfig((String[])get(key)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value<T> clone()
|
||||
{
|
||||
return new Value<T>(this);
|
||||
}
|
||||
|
||||
public static Iterator<String> GetAllKeys(Value<?>... values)
|
||||
{
|
||||
return GetAllKeys(null, values);
|
||||
}
|
||||
|
||||
public static Iterator<String> GetAllKeys(String[] sorted, Value<?>... values)
|
||||
{
|
||||
_allkeys.clear();
|
||||
for(int i = 0; i < values.length; i++)
|
||||
{
|
||||
Value<?> value = values[i];
|
||||
if(value.keyValues != null)
|
||||
{
|
||||
Enumeration<String> keys = value.keyValues.keys();
|
||||
while(keys.hasMoreElements())
|
||||
_allkeys.add(keys.nextElement());
|
||||
}
|
||||
}
|
||||
Collections.sort(_allkeys);
|
||||
_allkeys.add(0, Null);
|
||||
|
||||
for(int i = 0, n = 1; sorted != null && i < sorted.length; i++)
|
||||
{
|
||||
String sort = sorted[i];
|
||||
if(sort == null || sort == Null)
|
||||
continue;
|
||||
|
||||
if(_allkeys.remove(sort))
|
||||
_allkeys.add(n++, sort);
|
||||
}
|
||||
|
||||
return _allkeys.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if(!(other instanceof Value<?>))
|
||||
return false;
|
||||
|
||||
Value<T> otherValue = (Value<T>)other;
|
||||
if((value == null) != (otherValue.value == null))
|
||||
return false;
|
||||
if(value != null && !valuesEqual(value, otherValue.value))
|
||||
return false;
|
||||
if((keyValues == null ? 0 : keyValues.size()) != (otherValue.keyValues == null ? 0 : otherValue.keyValues.size()))
|
||||
return false;
|
||||
if(keyValues != null && keyValues.size() != 0)
|
||||
{
|
||||
Enumeration<String> keys = keyValues.keys();
|
||||
while(keys.hasMoreElements())
|
||||
{
|
||||
String key = keys.nextElement();
|
||||
T otherKeyValue = otherValue.keyValues.get(key);
|
||||
if(otherKeyValue == null)
|
||||
return false;
|
||||
T keyValue = keyValues.get(key);
|
||||
if(!valuesEqual(keyValue, otherKeyValue))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return value == null ? 0 : value.hashCode();
|
||||
}
|
||||
|
||||
private boolean valuesEqual(T first, T second)
|
||||
{
|
||||
if(!(first instanceof Object[]))
|
||||
return first.equals(second);
|
||||
|
||||
Object[] firstArray = (Object[])first;
|
||||
Object[] secondArray = (Object[])second;
|
||||
|
||||
if(firstArray.length != secondArray.length)
|
||||
return false;
|
||||
|
||||
for(int i=0; i<firstArray.length; i++)
|
||||
if(!firstArray[i].equals(secondArray[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public Value<T> load(String content, boolean singular)
|
||||
{
|
||||
if(content == null || singular)
|
||||
{
|
||||
value = parsePropertyElement(content);
|
||||
return this;
|
||||
}
|
||||
|
||||
String[] elements = content.split(";");
|
||||
for(int i = 0; i < elements.length; i++)
|
||||
{
|
||||
String element = elements[i];
|
||||
int seperatorIndex = element.indexOf(':');
|
||||
String key = null;
|
||||
String keyValue = null;
|
||||
if(seperatorIndex > 0)
|
||||
{
|
||||
key = element.substring(0, seperatorIndex);
|
||||
keyValue = element.substring(seperatorIndex + 1);
|
||||
}
|
||||
else
|
||||
keyValue = element;
|
||||
|
||||
T value = parsePropertyElement(keyValue);
|
||||
if(value != null)
|
||||
put(key, value);
|
||||
else
|
||||
{
|
||||
if (unparsableStrings == null)
|
||||
unparsableStrings = new ArrayList<String>();
|
||||
unparsableStrings.add(keyValue);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Iterator<String> getUnparsableStrings()
|
||||
{
|
||||
if(unparsableStrings != null)
|
||||
return unparsableStrings.iterator();
|
||||
return null;
|
||||
}
|
||||
|
||||
public void print(PrintWriter printer, String[] sorted)
|
||||
{
|
||||
boolean first = true;
|
||||
Iterator<String> keys = GetAllKeys(sorted, this);
|
||||
while(keys.hasNext())
|
||||
{
|
||||
String key = keys.next();
|
||||
if(key == Null && value == null)
|
||||
continue;
|
||||
|
||||
if(!first)
|
||||
printer.print(";");
|
||||
else
|
||||
first = false;
|
||||
|
||||
if(key != Null)
|
||||
{
|
||||
printer.print(key);
|
||||
printer.print(":");
|
||||
}
|
||||
|
||||
printDisplayString(printer, get(key));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringWriter result = new StringWriter();
|
||||
print(new PrintWriter(result), null);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static String createDisplayString(Object value)
|
||||
{
|
||||
if(value instanceof String[] || value instanceof Map)
|
||||
{
|
||||
StringWriter result = new StringWriter();
|
||||
printDisplayString(new PrintWriter(result), value);
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
return getDisplayString(value);
|
||||
}
|
||||
|
||||
private static void printDisplayString(PrintWriter printer, Object value)
|
||||
{
|
||||
if(value instanceof String[])
|
||||
{
|
||||
boolean first = true;
|
||||
String[] values = (String[])value;
|
||||
for(int i = 0; i < values.length; i++)
|
||||
{
|
||||
if(first)
|
||||
first = false;
|
||||
else
|
||||
printer.print(",");
|
||||
printer.print(getDisplayString(values[i]));
|
||||
}
|
||||
}
|
||||
else if(value instanceof Map)
|
||||
{
|
||||
boolean first = true;
|
||||
Map<?,?> values = (Map<?,?>)value;
|
||||
List<String> keys = new ArrayList<String>(values.size());
|
||||
for(Object key : values.keySet())
|
||||
keys.add((String)key);
|
||||
Collections.sort(keys);
|
||||
for(int i = 0; i < keys.size(); i++)
|
||||
{
|
||||
if(first)
|
||||
first = false;
|
||||
else
|
||||
printer.print(",");
|
||||
String key = keys.get(i);
|
||||
printer.print(getDisplayString(key));
|
||||
printer.print(",");
|
||||
printer.print(getDisplayString(values.get(key)));
|
||||
}
|
||||
}
|
||||
else
|
||||
printer.print(getDisplayString(value));
|
||||
}
|
||||
|
||||
private static String getDisplayString(Object value)
|
||||
{
|
||||
String result = value.toString();
|
||||
if(result.endsWith(".0"))
|
||||
result = result.substring(0, result.length() - 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
private T parsePropertyElement(String stringToParse)
|
||||
{
|
||||
int baseType = Properties.getBaseType(type);
|
||||
if(baseType == Properties.Boolean)
|
||||
return (T)tryParseBoolean(stringToParse);
|
||||
if(baseType == Properties.Float)
|
||||
return (T)tryParseFloat(stringToParse);
|
||||
if(baseType == Properties.Integer)
|
||||
return (T)tryParseInteger(stringToParse);
|
||||
if(baseType == Properties.Strings)
|
||||
return (T)tryParseStrings(stringToParse);
|
||||
if(baseType == Properties.StringMap)
|
||||
return (T)tryParseStringMap(stringToParse);
|
||||
if(baseType == Properties.IntegerMap)
|
||||
return (T)tryParseIntegerMap(stringToParse);
|
||||
if(baseType == Properties.String)
|
||||
return (T)tryParseString(stringToParse);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Boolean tryParseBoolean(String value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(value != null)
|
||||
return value.equals("true") ? Boolean.TRUE : value.equals("false") ? Boolean.FALSE : null;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Float tryParseFloat(String value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(value != null)
|
||||
return Float.parseFloat(value);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer tryParseInteger(String value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(value != null)
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String tryParseString(String value)
|
||||
{
|
||||
return value == null ? null : value;
|
||||
}
|
||||
|
||||
public static String[] tryParseStrings(String value)
|
||||
{
|
||||
return value == null ? null : (value.isEmpty() ? new String[0] : value.split(","));
|
||||
}
|
||||
|
||||
public static Map<String,String> tryParseStringMap(String value)
|
||||
{
|
||||
String[] keyValues = value.split(",");
|
||||
Map<String,String> result = new HashMap<String, String>();
|
||||
for(int i=0; i<keyValues.length; i++)
|
||||
{
|
||||
String key = keyValues[i++];
|
||||
if(i<keyValues.length)
|
||||
result.put(key, keyValues[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Map<String,Integer> tryParseIntegerMap(String value)
|
||||
{
|
||||
String[] keyValues = value.split(",");
|
||||
Map<String,Integer> result = new HashMap<String, Integer>();
|
||||
for(int i=0; i<keyValues.length; i++)
|
||||
{
|
||||
String key = keyValues[i++];
|
||||
if(i<keyValues.length)
|
||||
result.put(key, Integer.parseInt(keyValues[i]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Value<T> e(T e)
|
||||
{
|
||||
return this.put("e", e);
|
||||
}
|
||||
|
||||
public Value<T> m(T m)
|
||||
{
|
||||
return this.put("m", m);
|
||||
}
|
||||
|
||||
public Value<T> h(T h)
|
||||
{
|
||||
return this.put("h", h);
|
||||
}
|
||||
|
||||
public Value<T> c(T c)
|
||||
{
|
||||
return this.put("c", c);
|
||||
}
|
||||
|
||||
public Value<T> a(T a)
|
||||
{
|
||||
return this.put("a", a);
|
||||
}
|
||||
|
||||
public final static String Null = "null";
|
||||
private final static List<String> _allkeys = new LinkedList<String>();
|
||||
|
||||
public final static Class<?> keyboard = Reflect.LoadClass(Value.class, new Name("org.lwjgl.input.Keyboard"), false);
|
||||
public final static Class<?> mouse = Reflect.LoadClass(Value.class, new Name("org.lwjgl.input.Mouse"), false);
|
||||
|
||||
public final static Method _getKeyName = keyboard != null ? Reflect.GetMethod(keyboard, new Name("getKeyName"), int.class) : null;
|
||||
public final static Method _getKeyIndex = keyboard != null ? Reflect.GetMethod(keyboard, new Name("getKeyIndex"), String.class) : null;
|
||||
|
||||
public final static Method _getButtonName = mouse != null ? Reflect.GetMethod(mouse, new Name("getButtonName"), int.class) : null;
|
||||
public final static Method _getButtonIndex = mouse != null ? Reflect.GetMethod(mouse, new Name("getButtonIndex"), String.class) : null;
|
||||
|
||||
public static String toKeyName(Integer keyCode)
|
||||
{
|
||||
if(keyCode == null)
|
||||
return null;
|
||||
|
||||
if(keyCode >= 0)
|
||||
return (String)Reflect.Invoke(_getKeyName, null, keyCode);
|
||||
|
||||
return (String)Reflect.Invoke(_getButtonName, null, keyCode + 100);
|
||||
}
|
||||
|
||||
private static Integer toKeyCode(String keyName)
|
||||
{
|
||||
if(keyName == null)
|
||||
return null;
|
||||
|
||||
keyName = keyName.toUpperCase();
|
||||
int keyCode = (Integer)Reflect.Invoke(_getKeyIndex, null, keyName);
|
||||
if(keyCode > 0)
|
||||
return keyCode;
|
||||
|
||||
keyCode = (Integer)Reflect.Invoke(_getButtonIndex, null, keyName);
|
||||
if(keyCode >= 0)
|
||||
return keyCode - 100;
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Dictionary<Object, Set<Integer>> toBlockConfig(String[] config)
|
||||
{
|
||||
if(config == null)
|
||||
return null;
|
||||
|
||||
Dictionary<Object, Set<Integer>> result = new Hashtable<Object, Set<Integer>>();
|
||||
for(int i=0; i<config.length; i++)
|
||||
{
|
||||
String[] elements = config[i].split("/");
|
||||
if (elements.length > 0)
|
||||
{
|
||||
Set<Integer> metaDatas = new HashSet<Integer>();
|
||||
|
||||
String blockName = elements[0];
|
||||
result.put(blockName, metaDatas);
|
||||
|
||||
if (blockName.matches("[0-9]+"))
|
||||
result.put(Integer.parseInt(blockName), metaDatas);
|
||||
|
||||
for(int n=1; n<elements.length; n++)
|
||||
{
|
||||
String metaDataText = elements[n];
|
||||
if (metaDataText.matches("[0-9]+"))
|
||||
metaDatas.add(Integer.parseInt(metaDataText));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
// ==================================================================
|
||||
// This file is part of Smart Render.
|
||||
//
|
||||
// Smart Render is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Smart Render is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Smart Render. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ==================================================================
|
||||
|
||||
package net.smart.render;
|
||||
|
||||
import net.minecraft.client.model.*;
|
||||
import net.minecraft.entity.*;
|
||||
|
||||
public interface IModelPlayer
|
||||
{
|
||||
SmartRenderModel getRenderModel();
|
||||
|
||||
void initialize(ModelRenderer bipedBody, ModelRenderer bipedCloak, ModelRenderer bipedHead, ModelRenderer bipedEars, ModelRenderer bipedHeadwear, ModelRenderer bipedRightArm, ModelRenderer bipedLeftArm, ModelRenderer bipedRightLeg, ModelRenderer bipedLeftLeg);
|
||||
|
||||
void superRender(Entity entity, float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
|
||||
void superSetRotationAngles(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor, Entity entity);
|
||||
|
||||
void superRenderCloak(float f);
|
||||
|
||||
ModelRenderer getOuter();
|
||||
ModelRenderer getTorso();
|
||||
ModelRenderer getBody();
|
||||
ModelRenderer getBreast();
|
||||
ModelRenderer getNeck();
|
||||
ModelRenderer getHead();
|
||||
ModelRenderer getHeadwear();
|
||||
ModelRenderer getRightShoulder();
|
||||
ModelRenderer getRightArm();
|
||||
ModelRenderer getLeftShoulder();
|
||||
ModelRenderer getLeftArm();
|
||||
ModelRenderer getPelvic();
|
||||
ModelRenderer getRightLeg();
|
||||
ModelRenderer getLeftLeg();
|
||||
ModelRenderer getEars();
|
||||
ModelRenderer getCloak();
|
||||
|
||||
void animateHeadRotation(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateSleeping(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateArmSwinging(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateRiding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateLeftArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateRightArmItemHolding(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateWorkingBody(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateWorkingArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateSneaking(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateArms(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
void animateBowAiming(float totalHorizontalDistance, float currentHorizontalSpeed, float totalTime, float viewHorizontalAngelOffset, float viewVerticalAngelOffset, float factor);
|
||||
}
|
||||
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user