Merge branch 'master' into future

# Conflicts:
#	src/main/java/carpet/fakes/ClientSettingsC2SPacketInterface.java
#	src/main/java/carpet/mixins/ClientSettingsC2SPacket_scarpetMixin.java
#	src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java
This commit is contained in:
gnembon committed 2021-11-27 18:55:05 +01:00
commit 9750dd9e78
9 files changed
+9 -231

No files matched your search

-101
View File
@@ -1,101 +0,0 @@
package carpet.utils;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.text.BaseText;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
// not really needed anymore
public class EntityInfo
{
private static String makeTime(long ticks)
{
long secs = ticks/20;
if (secs < 60)
{
return String.format("%d\"", secs);
}
if (secs < 60*60)
{
return String.format("%d'%d\"", secs/60, secs%60);
}
return String.format("%dh%d'%d\"", secs/60/60, (secs % (60*60))/60,(secs % (60*60))%60 );
}
private static String display_item(ItemStack item)
{
if (item == null)
{
return null;
}
if (item.isEmpty()) // func_190926_b()
{
return null;
} // func_190916_E()
String stackname = item.getCount()>1?String.format("%dx%s",item.getCount(), item.getName().getString()):item.getName().getString();
if (item.isDamaged())
{
stackname += String.format(" %d/%d", item.getMaxUseTime()-item.getDamage(), item.getMaxUseTime());
}
if (item.hasEnchantments())
{
stackname += " ( ";
Map<Enchantment, Integer> enchants = EnchantmentHelper.get(item);
for (Enchantment e: enchants.keySet())
{
int level = enchants.get(e);
String enstring = e.getName(level).getString();
stackname += enstring+" ";
}
stackname += ")";
}
return stackname;
}
public static String entity_short_string(Entity e)
{
if (e == null)
{
return "None";
}
return String.format("%s at [%.1f, %.1f, %.1f]",e.getDisplayName().getString(), e.getX(), e.getY(), e.getZ());
}
private static double get_speed(double internal)
{
return 43.1*internal;
}
private static double get_horse_speed_percent(double internal)
{
double min = 0.45*0.25;
double max = (0.45+0.9)*0.25;
return 100*(internal-min)/(max-min);
}
private static double get_horse_jump(double x)
{
return -0.1817584952 * x*x*x + 3.689713992 * x*x + 2.128599134 * x - 0.343930367;
}
private static double get_horse_jump_percent(double internal)
{
double min = 0.4;
double max = 1.0;
return 100*(internal-min)/(max-min);
}
public static List<BaseText> entityInfo(Entity e, World source_world)
{
List<BaseText> lst = new ArrayList<>();
lst.add(Messenger.c("r Use /data get entity command"));
return lst;
}
}
-5
View File
@@ -100,11 +100,6 @@ public class WoolTool
case GRAY:
if (!"false".equals(CarpetSettings.commandInfo))
Messenger.send(placer, BlockInfo.blockInfo(pos.down(), worldIn));
break;
case YELLOW:
if (!"false".equals(CarpetSettings.commandInfo))
Messenger.m(placer, "r This used to show entity info around the player. Use data get entity command, sorry");
//EntityInfo.issue_entity_info(placer);
break;
case GREEN:
if (CarpetSettings.hopperCounters)