file_name
stringlengths 6
86
| file_path
stringlengths 45
249
| content
stringlengths 47
6.26M
| file_size
int64 47
6.26M
| language
stringclasses 1
value | extension
stringclasses 1
value | repo_name
stringclasses 767
values | repo_stars
int64 8
14.4k
| repo_forks
int64 0
1.17k
| repo_open_issues
int64 0
788
| repo_created_at
stringclasses 767
values | repo_pushed_at
stringclasses 767
values |
---|---|---|---|---|---|---|---|---|---|---|---|
TTree.java | /FileExtraction/Java_unseen/emacsist_java-trace-method-invoke-tree/src/com/github/emacsist/TTree.java | package com.github.emacsist;
import org.apache.commons.lang.StringUtils;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.System.currentTimeMillis;
/**
* Created by sky on 16-7-15.
*/
public class TTree {
private static final String STEP_FIRST_CHAR = "`---";
private static final String STEP_NORMAL_CHAR = "+---";
private static final String STEP_HAS_BOARD = "| ";
private static final String STEP_EMPTY_BOARD = " ";
// 是否输出耗时
private final boolean isPrintCost;
// 根节点
private final Node root;
// 当前节点
private Node current;
public TTree(boolean isPrintCost, String title) {
this.root = new Node(title).markBegin().markEnd();
this.current = root;
this.isPrintCost = isPrintCost;
}
public String rendering() {
final StringBuilder treeSB = new StringBuilder();
recursive(0, true, "", root, new Callback() {
@Override
public void callback(int deep, boolean isLast, String prefix, Node node) {
if (node.endTimestamp != 0) {
final boolean hasChild = !node.children.isEmpty();
final String stepString = isLast ? STEP_FIRST_CHAR : STEP_NORMAL_CHAR;
final int stepStringLength = StringUtils.length(stepString);
treeSB.append(prefix).append(stepString);
int costPrefixLength = 0;
if (hasChild) {
treeSB.append("+");
}
if (isPrintCost
&& !node.isRoot()) {
final String costPrefix = String.format("[%s,%sms]", (node.endTimestamp - root.beginTimestamp), (node.endTimestamp - node.beginTimestamp));
costPrefixLength = StringUtils.length(costPrefix);
treeSB.append(costPrefix);
}
final Scanner scanner = new Scanner(new StringReader(node.data.toString()));
try {
boolean isFirst = true;
while (scanner.hasNextLine()) {
if (isFirst) {
treeSB.append(scanner.nextLine()).append("\n");
isFirst = false;
} else {
treeSB
.append(prefix)
.append(StringUtils.repeat(" ", stepStringLength))
.append(hasChild ? "|" : " ")
.append(StringUtils.repeat(" ", costPrefixLength))
.append(scanner.nextLine())
.append("\n");
}
}
} finally {
scanner.close();
}
}
}
});
return treeSB.toString();
}
/**
* 递归遍历
*/
private void recursive(int deep, boolean isLast, String prefix, Node node, Callback callback) {
callback.callback(deep, isLast, prefix, node);
if (!node.isLeaf()) {
final int size = node.children.size();
for (int index = 0; index < size; index++) {
final boolean isLastFlag = index == size - 1;
final String currentPrefix = isLast ? prefix + STEP_EMPTY_BOARD : prefix + STEP_HAS_BOARD;
recursive(
deep + 1,
isLastFlag,
currentPrefix,
node.children.get(index),
callback
);
}
}
}
public boolean isTop() {
return current.isRoot();
}
/**
* 创建一个分支节点
*
* @param data 节点数据
* @return this
*/
public TTree begin(Object data) {
current = new Node(current, data);
current.markBegin();
return this;
}
public TTree begin() {
return begin(null);
}
public Object get() {
if (current.isRoot()) {
throw new IllegalStateException("current node is root.");
}
return current.data;
}
public TTree set(Object data) {
if (current.isRoot()) {
throw new IllegalStateException("current node is root.");
}
current.data = data;
return this;
}
/**
* 结束一个分支节点
*
* @return this
*/
public TTree end() {
if (current.isRoot()) {
throw new IllegalStateException("current node is root.");
}
current.markEnd();
current = current.parent;
return this;
}
/**
* 遍历回调接口
*/
private interface Callback {
void callback(int deep, boolean isLast, String prefix, Node node);
}
/**
* 树节点
*/
private static class Node {
/**
* 父节点
*/
final Node parent;
/**
* 子节点
*/
final List<Node> children = new ArrayList<Node>();
/**
* 节点数据
*/
Object data;
/**
* 开始时间戳
*/
private long beginTimestamp;
/**
* 结束时间戳
*/
private long endTimestamp;
/**
* 构造树节点(根节点)
*/
private Node(Object data) {
this.parent = null;
this.data = data;
}
/**
* 构造树节点
*
* @param parent 父节点
* @param data 节点数据
*/
private Node(Node parent, Object data) {
this.parent = parent;
this.data = data;
parent.children.add(this);
}
/**
* 是否根节点
*
* @return true / false
*/
boolean isRoot() {
return null == parent;
}
/**
* 是否叶子节点
*
* @return true / false
*/
boolean isLeaf() {
return children.isEmpty();
}
Node markBegin() {
beginTimestamp = currentTimeMillis();
return this;
}
Node markEnd() {
endTimestamp = currentTimeMillis();
return this;
}
}
}
| 6,685 | Java | .java | emacsist/java-trace-method-invoke-tree | 17 | 5 | 0 | 2016-07-15T09:54:19Z | 2016-07-15T10:39:07Z |
MixinSeedContainer.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-MagicalCrops/src/main/java/io/github/crucible/grimoire/mixins/magicalcrops/MixinSeedContainer.java | package io.github.crucible.grimoire.mixins.magicalcrops;
import com.mark719.magicalcrops.seedbags.SeedContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = SeedContainer.class, remap = false)
public abstract class MixinSeedContainer extends Container {
/**
* @author EverNife
* @reason Disable the Keyboard logic on the server-side to prevent 'java.lang.ClassNotFoundException: org.lwjgl.input.Keyboard'
*
* func_75144_a = slotClick
*/
@Overwrite
public ItemStack func_75144_a(int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer) {
/*
if (paramInt3 == 4 && paramEntityPlayer.worldObj.isRemote) {
return !Keyboard.isKeyDown(42) && !Keyboard.isKeyDown(54) ? super.slotClick(paramInt1, paramInt2, 0, paramEntityPlayer) : this.transferStackInSlot(paramEntityPlayer, paramInt1);
} else {
return super.slotClick(paramInt1, paramInt2, paramInt3, paramEntityPlayer);
}
*/
return super.slotClick(paramInt1, paramInt2, paramInt3, paramEntityPlayer);
}
}
| 1,274 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinMoveCheckReflector.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-FunkyLocomotion/src/main/java/io/github/crucible/grimoire/mixins/funkylocomotion/MixinMoveCheckReflector.java | package io.github.crucible.grimoire.mixins.funkylocomotion;
import com.rwtema.funkylocomotion.movepermissions.MoveCheckReflector;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
@Mixin(value = MoveCheckReflector.class, remap = false)
public abstract class MixinMoveCheckReflector {
@Shadow
@Final
private static HashMap<Class<?>, Boolean> cache;
/**
* @author Rehab_CZ
* @reason Add NoClassDefFoundError catch
*/
@Overwrite
private static boolean _canMoveClass(Class<?> clazz) {
try {
Method method = clazz.getMethod("_Immovable");
if (Modifier.isStatic(method.getModifiers()) &&
Modifier.isPublic(method.getModifiers()))
if (method.getReturnType() == boolean.class) {
Boolean b = (Boolean) method.invoke(null);
return b == null || !b;
}
return true;
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | RuntimeException |
NoClassDefFoundError e) {
return true;
} catch (Throwable e) {
e.printStackTrace();
return true;
}
}
/**
* @author Rehab_CZ [Taken from MagiHandlers]
* @reason Check for empty before move
*/
@Overwrite
public static boolean canMoveClass(Class<?> clazz) {
if (clazz == null) return true;
Boolean b = (Boolean) cache.get(clazz);
if (b == null) {
boolean bool = false;
try {
bool = _canMoveClass(clazz);
} catch (Throwable e) {
}
b = Boolean.valueOf(bool);
cache.put(clazz, b);
}
return b.booleanValue();
}
}
| 2,056 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
ItemRecipeResult.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/data/mekanism/ItemRecipeResult.java | package io.github.crucible.grimoire.data.mekanism;
import net.minecraft.item.ItemStack;
public class ItemRecipeResult {
ItemStack itemStack;
public ItemRecipeResult(ItemStack itemStack) {
this.itemStack = itemStack;
}
public ItemStack copyItemStack() {
return itemStack == null ? null : itemStack.copy();
}
}
| 350 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinFlamethrower.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/MixinFlamethrower.java | package io.github.crucible.grimoire.mixins.mekanism;
import com.gamerforea.eventhelper.util.EventUtils;
import mekanism.common.entity.EntityFlame;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = EntityFlame.class, remap = false)
public abstract class MixinFlamethrower {
@Shadow
public Entity owner;
@Inject(method = "burn", at = @At("HEAD"), cancellable = true)
private void checkPermission(Entity entity, CallbackInfo ci) {
if (EventUtils.cantDamage(owner, entity)) {
ci.cancel();
}
}
} | 799 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileEntityDigitalMiner.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/MixinTileEntityDigitalMiner.java | package io.github.crucible.grimoire.mixins.mekanism;
import io.github.crucible.grimoire.forge.core.ITileEntity;
import mekanism.common.CommonProxy;
import mekanism.common.tile.TileEntityDigitalMiner;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.WorldServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.lang.ref.WeakReference;
@Mixin(value = TileEntityDigitalMiner.class, remap = false)
public abstract class MixinTileEntityDigitalMiner implements ITileEntity {
@Redirect(method = "setReplace", at = @At(value = "INVOKE", target = "Lmekanism/common/CommonProxy;getDummyPlayer(Lnet/minecraft/world/WorldServer;DDD)Ljava/lang/ref/WeakReference;"))
private WeakReference<EntityPlayer> getDummyPlayerProxy(CommonProxy proxy, WorldServer world, double x, double y, double z) {
return new WeakReference<>(this.getFakePlayer());
}
}
| 995 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinStackUtils.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/MixinStackUtils.java | package io.github.crucible.grimoire.mixins.mekanism;
import mekanism.api.util.StackUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
// TODO: 17/10/2019 Verificar se está funcionando.
@Mixin(value = StackUtils.class, remap = false)
public abstract class MixinStackUtils {
/**
* @author juanmuscaria
* @reason Corrigir a verificação da ItemStack.
*/
@Overwrite
public static boolean diffIgnoreNull(ItemStack stack1, ItemStack stack2) {
if (stack1 == null || stack2 == null) {
return false;
}
return stack1.getItem() != stack2.getItem() || stack1.getItemDamage() != stack2.getItemDamage() || stack1.getTagCompound() != stack2.getTagCompound();
}
/**
* @author juanmuscaria
* @reason Corrigir a verificação da ItemStack.
*/
@Overwrite
public static boolean equalsWildcard(ItemStack wild, ItemStack check) {
if (wild != null && check != null) {
if (!wild.isStackable() || !check.isStackable()) return false;
return wild.getItem() == check.getItem() && (wild.getItemDamage() == OreDictionary.WILDCARD_VALUE || wild.getItemDamage() == check.getItemDamage());
} else
return check == wild;
}
} | 1,378 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinMekanismUtils.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/MixinMekanismUtils.java | package io.github.crucible.grimoire.mixins.mekanism;
import io.github.crucible.grimoire.data.mekanism.ItemRecipeResult;
import mekanism.common.util.MekanismUtils;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import java.util.HashMap;
import java.util.Iterator;
@Mixin(value = MekanismUtils.class, remap = false)
public abstract class MixinMekanismUtils {
private static final HashMap<String, ItemRecipeResult> cacheOfResults = new HashMap();
/**
* @author EverNife
* @reason Creates a cache for the recipes found to prevent high CPU usage.
*
* May cause inconsistency on ULTRA RARE CASES, where you refresh the recipes,
* for example with CraftTweaker after they had been unsed by this class.
*
* Note, this optimization will not work for items with NBT
*
*/
@Overwrite
public static ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
ItemStack[] dmgItems = new ItemStack[2];
for(int i = 0; i < inv.getSizeInventory(); ++i) {
if (inv.getStackInSlot(i) != null) {
if (dmgItems[0] != null) {
dmgItems[1] = inv.getStackInSlot(i);
break;
}
dmgItems[0] = inv.getStackInSlot(i);
}
}
if (dmgItems[0] != null && dmgItems[0].getItem() != null) {
if (dmgItems[1] != null && dmgItems[0].getItem() == dmgItems[1].getItem() && dmgItems[0].stackSize == 1 && dmgItems[1].stackSize == 1 && dmgItems[0].getItem().isRepairable()) {
Item theItem = dmgItems[0].getItem();
int dmgDiff0 = theItem.getMaxDamage() - dmgItems[0].getItemDamageForDisplay();
int dmgDiff1 = theItem.getMaxDamage() - dmgItems[1].getItemDamageForDisplay();
int value = dmgDiff0 + dmgDiff1 + theItem.getMaxDamage() * 5 / 100;
int solve = Math.max(0, theItem.getMaxDamage() - value);
return new ItemStack(dmgItems[0].getItem(), 1, solve);
} else {
//Grimoire Start
StringBuilder identifier = new StringBuilder();
boolean hasNBT = false;
for (int i = 0; i < inv.getSizeInventory(); ++i){
ItemStack itemstack1 = inv.getStackInSlot(i);
if (itemstack1 != null){
if (itemstack1.hasTagCompound()){
hasNBT = true;
break;
}
identifier.append(itemstack1.getItem().getUnlocalizedName() + "---" + itemstack1.getItemDamage());
}
}
if (!hasNBT){
ItemRecipeResult result = cacheOfResults.get(identifier.toString());
if (result != null) {
return result.copyItemStack();
}
}
Iterator var8 = CraftingManager.getInstance().getRecipeList().iterator();
IRecipe recipe;
do {
if (!var8.hasNext()) {
return null;
}
recipe = (IRecipe)var8.next();
} while(!recipe.matches(inv, world));
ItemStack finalResult = recipe.getCraftingResult(inv);
if (!hasNBT){
cacheOfResults.put(identifier.toString(), new ItemRecipeResult(finalResult.copy()));
}
return finalResult;
}
} else {
return null;
}
}
} | 3,924 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinBinRecipe.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/MixinBinRecipe.java | package io.github.crucible.grimoire.mixins.mekanism;
import mekanism.common.recipe.BinRecipe;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
// TODO: 17/10/2019 Corrigir o recipe ao invés de desativar.
@Mixin(value = BinRecipe.class, remap = false)
public abstract class MixinBinRecipe {
/**
* @author juanmuscaria
* @reason Desativa os recipes do silo.
*/
@Overwrite
public ItemStack getResult(IInventory inv) {
return null;
}
} | 594 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerElectricPump.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerElectricPump.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerElectricPump;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerElectricPump.class, remap = false)
public abstract class MixinContainerElectricPump extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 688 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerLaserAmplifier.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerLaserAmplifier.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerLaserAmplifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerLaserAmplifier.class, remap = false)
public abstract class MixinContainerLaserAmplifier extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 694 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChemicalInfuser.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChemicalInfuser.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChemicalInfuser;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChemicalInfuser.class, remap = false)
public abstract class MixinContainerChemicalInfuser extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 697 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerDynamicTank.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerDynamicTank.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerDynamicTank;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerDynamicTank.class, remap = false)
public abstract class MixinContainerDynamicTank extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 685 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerRotaryCondensentrator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerRotaryCondensentrator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerRotaryCondensentrator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerRotaryCondensentrator.class, remap = false)
public abstract class MixinContainerRotaryCondensentrator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 715 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerEnergyCube.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerEnergyCube.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerEnergyCube;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerEnergyCube.class, remap = false)
public abstract class MixinContainerEnergyCube extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 682 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFactory.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFactory.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFactory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFactory.class, remap = false)
public abstract class MixinContainerFactory extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 673 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerSeismicVibrator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerSeismicVibrator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerSeismicVibrator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerSeismicVibrator.class, remap = false)
public abstract class MixinContainerSeismicVibrator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 697 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerRobitMain.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerRobitMain.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerRobitMain;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerRobitMain.class, remap = false)
public abstract class MixinContainerRobitMain extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 679 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerElectricMachine.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerElectricMachine.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerElectricMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerElectricMachine.class, remap = false)
public abstract class MixinContainerElectricMachine extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 697 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChemicalCrystallizer.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChemicalCrystallizer.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChemicalCrystallizer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChemicalCrystallizer.class, remap = false)
public abstract class MixinContainerChemicalCrystallizer extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 712 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerQuantumEntangloporter.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerQuantumEntangloporter.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerQuantumEntangloporter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerQuantumEntangloporter.class, remap = false)
public abstract class MixinContainerQuantumEntangloporter extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 715 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFluidicPlenisher.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFluidicPlenisher.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFluidicPlenisher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFluidicPlenisher.class, remap = false)
public abstract class MixinContainerFluidicPlenisher extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 700 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerUpgradeManagement.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerUpgradeManagement.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerUpgradeManagement;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerUpgradeManagement.class, remap = false)
public abstract class MixinContainerUpgradeManagement extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 703 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerDictionary.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerDictionary.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerDictionary;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerDictionary.class, remap = false)
public abstract class MixinContainerDictionary extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 682 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerElectrolyticSeparator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerElectrolyticSeparator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerElectrolyticSeparator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerElectrolyticSeparator.class, remap = false)
public abstract class MixinContainerElectrolyticSeparator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 715 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerThermalEvaporationController.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerThermalEvaporationController.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerThermalEvaporationController;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerThermalEvaporationController.class, remap = false)
public abstract class MixinContainerThermalEvaporationController extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 736 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChemicalDissolutionChamber.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChemicalDissolutionChamber.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChemicalDissolutionChamber;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChemicalDissolutionChamber.class, remap = false)
public abstract class MixinContainerChemicalDissolutionChamber extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 730 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerPersonalChest.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerPersonalChest.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerPersonalChest;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerPersonalChest.class, remap = false)
public abstract class MixinContainerPersonalChest extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 691 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFormulaicAssemblicator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFormulaicAssemblicator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFormulaicAssemblicator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFormulaicAssemblicator.class, remap = false)
public abstract class MixinContainerFormulaicAssemblicator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 718 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerOredictionificator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerOredictionificator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerOredictionificator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerOredictionificator.class, remap = false)
public abstract class MixinContainerOredictionificator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 706 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerGasTank.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerGasTank.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerGasTank;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerGasTank.class, remap = false)
public abstract class MixinContainerGasTank extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 673 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerRobitSmelting.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerRobitSmelting.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerRobitSmelting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerRobitSmelting.class, remap = false)
public abstract class MixinContainerRobitSmelting extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 691 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerSecurityDesk.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerSecurityDesk.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerSecurityDesk;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerSecurityDesk.class, remap = false)
public abstract class MixinContainerSecurityDesk extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 688 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChanceMachine.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChanceMachine.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChanceMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChanceMachine.class, remap = false)
public abstract class MixinContainerChanceMachine extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 691 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerAdvancedElectricMachine.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerAdvancedElectricMachine.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerAdvancedElectricMachine.class, remap = false)
public abstract class MixinContainerAdvancedElectricMachine extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 721 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChemicalOxidizer.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChemicalOxidizer.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChemicalOxidizer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChemicalOxidizer.class, remap = false)
public abstract class MixinContainerChemicalOxidizer extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 700 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerTeleporter.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerTeleporter.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerTeleporter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerTeleporter.class, remap = false)
public abstract class MixinContainerTeleporter extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 682 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerResistiveHeater.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerResistiveHeater.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerResistiveHeater;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerResistiveHeater.class, remap = false)
public abstract class MixinContainerResistiveHeater extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 697 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerRobitInventory.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerRobitInventory.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerRobitInventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerRobitInventory.class, remap = false)
public abstract class
MixinContainerRobitInventory extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 694 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerInductionMatrix.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerInductionMatrix.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerInductionMatrix;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerInductionMatrix.class, remap = false)
public abstract class MixinContainerInductionMatrix extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 697 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFluidTank.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFluidTank.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFluidTank;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFluidTank.class, remap = false)
public abstract class MixinContainerFluidTank extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 679 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerMetallurgicInfuser.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerMetallurgicInfuser.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerMetallurgicInfuser.class, remap = false)
public abstract class MixinContainerMetallurgicInfuser extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 706 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerChemicalWasher.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerChemicalWasher.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerChemicalWasher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerChemicalWasher.class, remap = false)
public abstract class MixinContainerChemicalWasher extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 694 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerDigitalMiner.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerDigitalMiner.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerDigitalMiner;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerDigitalMiner.class, remap = false)
public abstract class MixinContainerDigitalMiner extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 688 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFilter.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFilter.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFilter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFilter.class, remap = false)
public abstract class MixinContainerFilter extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 670 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerFuelwoodHeater.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerFuelwoodHeater.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerFuelwoodHeater;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerFuelwoodHeater.class, remap = false)
public abstract class MixinContainerFuelwoodHeater extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 694 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerLaserTractorBeam.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerLaserTractorBeam.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerLaserTractorBeam;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerLaserTractorBeam.class, remap = false)
public abstract class MixinContainerLaserTractorBeam extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 700 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerSolarNeutronActivator.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerSolarNeutronActivator.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerSolarNeutronActivator.class, remap = false)
public abstract class MixinContainerSolarNeutronActivator extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 715 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinContainerPRC.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Mekanism/src/main/java/io/github/crucible/grimoire/mixins/mekanism/containers/MixinContainerPRC.java | package io.github.crucible.grimoire.mixins.mekanism.containers;
import mekanism.common.inventory.container.ContainerPRC;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = ContainerPRC.class, remap = false)
public abstract class MixinContainerPRC extends Container {
/**
* @author EverNife
* @reason Desativar Shift-Click para prevenir dupes
*/
@Overwrite
public ItemStack func_82846_b(EntityPlayer player, int slotID) {
return null;
}
}
| 661 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinBlockMannequin.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-ArmourersWorkshop/src/main/java/io/github/crucible/grimoire/mixins/armourersworkshop/MixinBlockMannequin.java | package io.github.crucible.grimoire.mixins.armourersworkshop;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Pseudo;
import riskyken.armourersWorkshop.ArmourersWorkshop;
import riskyken.armourersWorkshop.common.blocks.BlockMannequin;
import riskyken.armourersWorkshop.common.items.ModItems;
import riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin;
@Pseudo
@Mixin(value = BlockMannequin.class)
public abstract class MixinBlockMannequin {
/**
* @author EverNife
* @reason Fire a break-event before opening a manequin!
*/
@Overwrite(remap = true)
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xHit, float yHit, float zHit) {
if (!player.canPlayerEdit(x, y, z, side, player.getCurrentEquippedItem())) {
return false;
} else {
if (!world.isRemote) {
//Mixin Start
if (EventUtils.cantBreak(player,x,y,z)){
return false;
}
//Mixin End
if (player.inventory.getCurrentItem() != null) {
if (player.inventory.getCurrentItem().getItem() == ModItems.mannequinTool) {
return false;
}
if (player.inventory.getCurrentItem().getItem() == ModItems.paintbrush) {
return false;
}
}
int meta = world.getBlockMetadata(x, y, z);
int yOffset = 0;
if (meta == 1) {
yOffset = -1;
}
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.getItem() == Items.name_tag) {
TileEntity te = world.getTileEntity(x, y + yOffset, z);
if (te instanceof TileEntityMannequin && stack.getItem() == Items.name_tag) {
((TileEntityMannequin)te).setOwner(player.getCurrentEquippedItem());
}
} else {
FMLNetworkHandler.openGui(player, ArmourersWorkshop.instance, 6, world, x, y + yOffset, z);
}
}
return player.inventory.getCurrentItem() == null || player.inventory.getCurrentItem().getItem() != ModItems.mannequinTool;
}
}
}
| 2,772 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinItemFocusTrade.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinItemFocusTrade.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.common.items.wands.foci.ItemFocusTrade;
@Mixin(value = ItemFocusTrade.class, remap = false)
public abstract class MixinItemFocusTrade {
@Inject(method = "onFocusRightClick", at = @At("HEAD"), cancellable = true)
private void onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop, CallbackInfoReturnable<ItemStack> ci) {
if (!EventUtils.hasPermission(player, "feather.thaumcraft.focus.trade")) {
player.addChatMessage(new ChatComponentTranslation("servertext.focus.permission"));
ci.setReturnValue(itemstack);
ci.cancel();
}
}
}
| 1,205 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinBlockTable.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinBlockTable.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.common.blocks.BlockTable;
@Mixin(value = BlockTable.class, remap = false)
public abstract class MixinBlockTable {
@Inject(method = "func_149727_a", at = @At(value = "INVOKE"), cancellable = true)
private void verifyOpenContainer(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are, CallbackInfoReturnable<Boolean> ci) {
if (player instanceof FakePlayer) return;
if (player instanceof EntityPlayerMP) {
EntityPlayerMP playerMP = (EntityPlayerMP) player;
playerMP.closeScreen();
} else
throw new IllegalArgumentException("Foi passado um objeto que não é um jogador:" + player.getClass().getName());
}
} | 1,204 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileNode.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinTileNode.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import net.minecraft.world.biome.BiomeGenBase;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.api.TileThaumcraft;
import thaumcraft.api.nodes.INode;
import thaumcraft.api.nodes.NodeType;
import thaumcraft.api.wands.IWandable;
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
import thaumcraft.common.tiles.TileNode;
@Mixin(value = TileNode.class, remap = false)
public abstract class MixinTileNode extends TileThaumcraft implements INode, IWandable {
@Shadow
int count;
@Shadow
public abstract void nodeChange();
@Inject(method = "handleTaintNode", at = @At("HEAD"), cancellable = true)
private void diableGriefingTaintNode(boolean change, CallbackInfoReturnable<Boolean> ci) {
if (this.getNodeType() != NodeType.PURE && this.getNodeType() != NodeType.TAINTED && this.count % 100 == 0) {
BiomeGenBase bg = this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord);
if (bg.biomeID == ThaumcraftWorldGenerator.biomeTaint.biomeID && this.worldObj.rand.nextInt(500) == 0) {
this.setNodeType(NodeType.TAINTED);
this.nodeChange();
}
}
ci.setReturnValue(change);
ci.cancel();
}
@Inject(method = "handleHungryNodeSecond", at = @At("HEAD"), cancellable = true)
private void diableGriefingHungryNode(boolean change, CallbackInfoReturnable<Boolean> ci) {
ci.setReturnValue(change);
ci.cancel();
}
}
| 1,756 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileArcaneBore.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinTileArcaneBore.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import io.github.crucible.grimoire.forge.core.ITileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import thaumcraft.common.tiles.TileArcaneBore;
@Mixin(value = TileArcaneBore.class, remap = false)
public abstract class MixinTileArcaneBore implements ITileEntity {
@Shadow
int digX;
@Shadow
int digY;
@Shadow
int digZ;
@Inject(method = "dig", at = @At("HEAD"), cancellable = true)
private void checkPermission(CallbackInfo ci) {
if (EventUtils.cantBreak(getFakePlayer(), digX, digY, digZ)) ci.cancel();
}
}
| 876 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityEldritchGolem.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinEntityEldritchGolem.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import io.github.crucible.grimoire.forge.core.FakePlayerManager;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import thaumcraft.common.entities.monster.boss.EntityEldritchGolem;
@Mixin(value = EntityEldritchGolem.class, remap = false)
public abstract class MixinEntityEldritchGolem {
@Redirect(method = "func_70636_d", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;func_147480_a(IIIZ)Z"))
private boolean breakBlockProxy(World world, int x, int y, int z, boolean slaOqSeriaIsso) {
if (EventUtils.cantBreak(FakePlayerManager.get((WorldServer) world), x, y, z)) return false;
else return world.func_147480_a(x, y, z, slaOqSeriaIsso);
}
}
| 967 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityBottleTaint.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinEntityBottleTaint.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import io.github.crucible.grimoire.forge.core.FakePlayerManager;
import io.github.crucible.grimoire.forge.core.IThrowableHook;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.biome.BiomeGenBase;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import thaumcraft.common.entities.projectile.EntityBottleTaint;
import thaumcraft.common.lib.utils.Utils;
@Mixin(value = EntityBottleTaint.class, remap = false)
public abstract class MixinEntityBottleTaint extends EntityThrowable implements IThrowableHook {
public MixinEntityBottleTaint(World seraQueAlguemLeEssasCoisas) {
super(seraQueAlguemLeEssasCoisas);
}
@Inject(method = "func_70184_a", at = @At("HEAD"), cancellable = true)
private void checkPermission(MovingObjectPosition pos, CallbackInfo ci) {
if (getThrower() == null) setThrower(FakePlayerManager.get((WorldServer) worldObj));
if (this.getThrower() instanceof EntityPlayer) {
if (EventUtils.cantBreak((EntityPlayer) this.getThrower(), pos.blockX, pos.blockY, pos.blockZ)) {
setDead();
ci.cancel();
}
} else {
setDead();
ci.cancel();
}
}
@Redirect(method = "func_70184_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;func_147465_d(IIILnet/minecraft/block/Block;II)Z"))
private boolean setBlockProxy(World world, int x, int y, int z, Block block, int i, int i2, MovingObjectPosition pos) {
if (getThrower() instanceof EntityPlayer && EventUtils.cantBreak((EntityPlayer) getThrower(), x, y, z))
return false;
else return world.setBlock(x, y, z, block, i, i2);
}
@Redirect(method = "func_70184_a", at = @At(value = "INVOKE", target = "Lthaumcraft/common/lib/utils/Utils;setBiomeAt(Lnet/minecraft/world/World;IILnet/minecraft/world/biome/BiomeGenBase;)V"))
private void setBiomeAtProxy(World world, int x, int z, BiomeGenBase biome, MovingObjectPosition pos) {
if (!(getThrower() instanceof EntityPlayer) || !EventUtils.cantBreak((EntityPlayer) getThrower(), x, pos.blockY, z)) {
Utils.setBiomeAt(world, x, z, biome);
}
}
}
| 2,736 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinItemFocusPortableHole.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinItemFocusPortableHole.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.common.items.wands.foci.ItemFocusPortableHole;
@Mixin(value = ItemFocusPortableHole.class, remap = false)
public abstract class MixinItemFocusPortableHole {
/**
* @author juanmuscaria
*/
// TODO: 15/10/2019 Refazer toda a lógica do blackhole focus.
@Inject(method = "onFocusRightClick", at = @At("HEAD"), cancellable = true)
private void onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop, CallbackInfoReturnable<ItemStack> ci) {
if (!EventUtils.hasPermission(player, "feather.thaumcraft.focus.blackhole")) {
player.addChatMessage(new ChatComponentTranslation("servertext.focus.permission"));
ci.setReturnValue(itemstack);
ci.cancel();
}
}
}
| 1,341 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinWandManager.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinWandManager.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.common.items.wands.WandManager;
@Mixin(value = WandManager.class, remap = false)
public abstract class MixinWandManager {
@Inject(method = "createCrucible", at = @At("HEAD"), cancellable = true)
private static void checkPermission(ItemStack is, EntityPlayer player, World world, int x, int y, int z, CallbackInfoReturnable<Boolean> ci) {
if (EventUtils.cantBreak(player, x, y, z)) {
player.addChatMessage(new ChatComponentText("§4This focus is temporarily disabled."));
ci.setReturnValue(false);
ci.cancel();
}
}
@Inject(method = "createThaumonomicon", at = @At("HEAD"), cancellable = true)
private static void checkPermission2(ItemStack is, EntityPlayer player, World world, int x, int y, int z, CallbackInfoReturnable<Boolean> ci) {
if (EventUtils.cantBreak(player, x, y, z)) {
player.addChatMessage(new ChatComponentText("§4This focus is temporarily disabled."));
ci.setReturnValue(false);
ci.cancel();
}
}
}
| 1,557 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinThaumcraftCraftingManager.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinThaumcraftCraftingManager.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Shadow;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
import java.util.*;
@Pseudo
@Mixin(value = ThaumcraftCraftingManager.class, remap = false)
public abstract class MixinThaumcraftCraftingManager {
@Shadow
private static AspectList capAspects(AspectList sourcetags, int amount) {
return null;
}
@Shadow
public static AspectList generateTags(Item item, int meta) {
return null;
}
private static AspectList getObjectTagsDummyFunction(ItemStack itemstack, Item item, int meta) {
AspectList tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, meta));
if (tmp == null) {
Collection<List> col = ThaumcraftApi.objectTags.keySet();
Iterator i$ = col.iterator();
while(i$.hasNext()) {
List l = (List)i$.next();
if (l.get(0) == item && l.get(1) instanceof int[]) {
int[] range = (int[]) l.get(1);
Arrays.sort(range);
if (Arrays.binarySearch(range, meta) >= 0) {
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, range));
return tmp;
}
}
}
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, 32767));
if (tmp == null && tmp == null) {
if (meta == 32767 && tmp == null) {
int index = 0;
do {
tmp = ThaumcraftApi.objectTags.get(Arrays.asList(item, index));
++index;
} while(index < 16 && tmp == null);
}
if (tmp == null) {
tmp = generateTags(item, meta);
}
}
}
if (itemstack.getItem() instanceof ItemWandCasting) {
ItemWandCasting wand = (ItemWandCasting)itemstack.getItem();
if (tmp == null) {
tmp = new AspectList();
}
tmp.merge(Aspect.MAGIC, (wand.getRod(itemstack).getCraftCost() + wand.getCap(itemstack).getCraftCost()) / 2);
tmp.merge(Aspect.TOOL, (wand.getRod(itemstack).getCraftCost() + wand.getCap(itemstack).getCraftCost()) / 3);
}
if (item != null && item == Items.potionitem) {
if (tmp == null) {
tmp = new AspectList();
}
tmp.merge(Aspect.WATER, 1);
ItemPotion ip = (ItemPotion)item;
List effects = ip.getEffects(itemstack.getItemDamage());
if (effects != null) {
if (ItemPotion.isSplash(itemstack.getItemDamage())) {
tmp.merge(Aspect.ENTROPY, 2);
}
Iterator var5 = effects.iterator();
while(var5.hasNext()) {
PotionEffect var6 = (PotionEffect)var5.next();
tmp.merge(Aspect.MAGIC, (var6.getAmplifier() + 1) * 2);
if (var6.getPotionID() == Potion.blindness.id) {
tmp.merge(Aspect.DARKNESS, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.confusion.id) {
tmp.merge(Aspect.ELDRITCH, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.damageBoost.id) {
tmp.merge(Aspect.WEAPON, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.digSlowdown.id) {
tmp.merge(Aspect.TRAP, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.digSpeed.id) {
tmp.merge(Aspect.TOOL, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.fireResistance.id) {
tmp.merge(Aspect.ARMOR, var6.getAmplifier() + 1);
tmp.merge(Aspect.FIRE, (var6.getAmplifier() + 1) * 2);
} else if (var6.getPotionID() == Potion.harm.id) {
tmp.merge(Aspect.DEATH, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.heal.id) {
tmp.merge(Aspect.HEAL, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.hunger.id) {
tmp.merge(Aspect.DEATH, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.invisibility.id) {
tmp.merge(Aspect.SENSES, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.jump.id) {
tmp.merge(Aspect.FLIGHT, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.moveSlowdown.id) {
tmp.merge(Aspect.TRAP, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.moveSpeed.id) {
tmp.merge(Aspect.MOTION, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.nightVision.id) {
tmp.merge(Aspect.SENSES, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.poison.id) {
tmp.merge(Aspect.POISON, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.regeneration.id) {
tmp.merge(Aspect.HEAL, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.resistance.id) {
tmp.merge(Aspect.ARMOR, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.waterBreathing.id) {
tmp.merge(Aspect.AIR, (var6.getAmplifier() + 1) * 3);
} else if (var6.getPotionID() == Potion.weakness.id) {
tmp.merge(Aspect.DEATH, (var6.getAmplifier() + 1) * 3);
}
}
}
}
return capAspects(tmp, 64);
}
private static final HashMap<String, AspectList> mapOfAspects = new HashMap<String, AspectList>();
private static final AspectList EMPTY_ASPECT_LIST = new AspectList();
/**
* @author EverNife
* @reason Ao se criar um cache para o mapa de aspectos, se previne uma IMENSA quantidade de lag em alguns casos especificos!
*/
@Overwrite
public static AspectList getObjectTags(ItemStack itemstack) {
Item item;
int meta;
try {
item = itemstack.getItem();
meta = itemstack.getItemDamage();
} catch (Exception var8) {
return null;
}
String identifier = item.getUnlocalizedName() + "-" + meta;
AspectList aspectList = mapOfAspects.getOrDefault(identifier,null);
if (aspectList == null){
aspectList = getObjectTagsDummyFunction(itemstack,item,meta);
if (aspectList == null){
aspectList = EMPTY_ASPECT_LIST;
}
mapOfAspects.put(identifier,aspectList);
}
return aspectList != EMPTY_ASPECT_LIST ? aspectList : null;
}
}
| 7,877 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileArcaneLampGrowth.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinTileArcaneLampGrowth.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Pseudo;
import thaumcraft.common.tiles.TileArcaneLampGrowth;
@Pseudo
@Mixin(value = TileArcaneLampGrowth.class, remap = false)
public class MixinTileArcaneLampGrowth {
/**
* @author EverNife
* @reason Desativa esse item imundo...
*
* 49 lampadas dessa fazem o trabalho de 1750 sprinklers
*
* https://media.discordapp.net/attachments/211161697421885441/671403055568388096/Growth_Lamp.gif?
*/
@Overwrite()
public void func_145845_h() {
}
/**
* @author EverNife
* @reason Desativa esse item imundo...
*
* 49 lampadas dessa fazem o trabalho de 1750 sprinklers
*
* https://media.discordapp.net/attachments/211161697421885441/671403055568388096/Growth_Lamp.gif?
*/
@Overwrite()
private void updatePlant(){
}
/**
* @author EverNife
* @reason Desativa esse item imundo...
*
* 49 lampadas dessa fazem o trabalho de 1750 sprinklers
*
* https://media.discordapp.net/attachments/211161697421885441/671403055568388096/Growth_Lamp.gif?
*/
@Overwrite()
boolean drawEssentia(){
return false;
}
/**
* @author EverNife
* @reason Desativa esse item imundo...
*
* 49 lampadas dessa fazem o trabalho de 1750 sprinklers
*
* https://media.discordapp.net/attachments/211161697421885441/671403055568388096/Growth_Lamp.gif?
*/
@Overwrite()
public boolean canUpdate(){
return false;
}
}
| 1,667 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinItemFocusPrimal.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinItemFocusPrimal.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import thaumcraft.common.items.wands.foci.ItemFocusPrimal;
@Mixin(value = ItemFocusPrimal.class, remap = false)
public abstract class MixinItemFocusPrimal {
@Inject(method = "onFocusRightClick", at = @At("HEAD"), cancellable = true)
private void onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop, CallbackInfoReturnable<ItemStack> ci) {
if (!EventUtils.hasPermission(player, "feather.thaumcraft.focus.primal")) {
player.addChatMessage(new ChatComponentTranslation("servertext.focus.permission"));
ci.setReturnValue(itemstack);
ci.cancel();
}
}
}
| 1,209 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityCultistPortal.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinEntityCultistPortal.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import io.github.crucible.grimoire.forge.core.FakePlayerManager;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import thaumcraft.common.entities.monster.boss.EntityCultistPortal;
@Mixin(value = EntityCultistPortal.class, remap = false)
public abstract class MixinEntityCultistPortal {
@Redirect(method = "func_70071_h_", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;func_147465_d(IIILnet/minecraft/block/Block;II)Z"))
private boolean setBlockProxy(World world, int x, int y, int z, Block block, int i1, int i2) {
if (EventUtils.cantBreak(FakePlayerManager.get((WorldServer) world), x, y, z) || world.getTileEntity(x, y, z) != null)
return false;
else return world.setBlock(x, y, z, block, i1, i2);
}
}
| 1,078 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityPrimalOrb.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Thaumcraft/src/main/java/io/github/crucible/grimoire/mixins/thaumcraft/MixinEntityPrimalOrb.java | package io.github.crucible.grimoire.mixins.thaumcraft;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import thaumcraft.common.entities.projectile.EntityPrimalOrb;
@Mixin(value = EntityPrimalOrb.class, remap = false)
public abstract class MixinEntityPrimalOrb extends EntityThrowable {
public MixinEntityPrimalOrb(World world) {
super(world);
}
@Inject(method = "func_70184_a", at = @At("HEAD"), cancellable = true)
private void checkPermission(MovingObjectPosition pos, CallbackInfo ci) {
if (this.getThrower() instanceof EntityPlayer) {
if (EventUtils.cantBreak((EntityPlayer) this.getThrower(), pos.blockX, pos.blockY, pos.blockZ)) {
setDead();
ci.cancel();
}
}
}
}
| 1,175 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinGuiIngame.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-CrucibleTimeMachine/src/main/java/io/github/crucible/grimoire/mixins/crucibletimemachine/MixinGuiIngame.java | package io.github.crucible.grimoire.mixins.crucibletimemachine;
import net.minecraft.client.gui.GuiIngame;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = GuiIngame.class)
public abstract class MixinGuiIngame {
@Inject(method = "renderBossHealth",at = @At("HEAD"), cancellable = true)
private void renderBossHealth(CallbackInfo ci){
boolean ready = false;
try {
Class<?> clazz = Class.forName("io.github.crucible.timemachine.bossbar.BossBarAPI");
ready = (boolean) clazz.getDeclaredField("READY").get(null);
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException ignored) {}
if(ready){
ci.cancel();
}
}
}
| 907 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinThermalTile.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-CoFH/src/main/java/io/github/crucible/grimoire/mixins/cofh/MixinThermalTile.java | package io.github.crucible.grimoire.mixins.cofh;
import cofh.core.network.PacketCoFHBase;
import cofh.thermalexpansion.block.cache.TileCache;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = {TileCache.class}, remap = false)
public class MixinThermalTile {
@Inject(method = "handleTilePacket", at = @At("INVOKE"), cancellable = true)
private void handleTilePacket(PacketCoFHBase payload, boolean isServer, CallbackInfo ci) {
ci.cancel();
}
}
| 643 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinSecurityHelper.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-CoFH/src/main/java/io/github/crucible/grimoire/mixins/cofh/MixinSecurityHelper.java | package io.github.crucible.grimoire.mixins.cofh;
import cofh.lib.util.helpers.SecurityHelper;
import com.mojang.authlib.GameProfile;
import net.minecraft.server.MinecraftServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import java.util.UUID;
@Mixin(value = SecurityHelper.class, remap = false)
public class MixinSecurityHelper {
/**
* @author juanmuscaria
* @reason Remove a stacktrace quando não conseguir baixar o profile do jogador.
*/
@Overwrite
public static GameProfile getProfile(UUID uuid, String name) {
try {
GameProfile var2 = MinecraftServer.getServer().func_152358_ax().func_152652_a(uuid);
if (var2 == null) {
GameProfile var3 = new GameProfile(uuid, name);
var2 = MinecraftServer.getServer().func_147130_as().fillProfileProperties(var3, true);
if (var2 != var3) {
MinecraftServer.getServer().func_152358_ax().func_152649_a(var2);
}
}
return var2;
} catch (Exception ignore) {
return null;
}
}
}
| 1,161 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityTinyTNTPrimed.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-AppliedEnergistics/src/main/java/io/github/crucible/grimoire/mixins/appliedenergistics/MixinEntityTinyTNTPrimed.java | package io.github.crucible.grimoire.mixins.appliedenergistics;
import appeng.core.AEConfig;
import appeng.core.features.AEFeature;
import appeng.entity.EntityTinyTNTPrimed;
import net.minecraft.entity.item.EntityTNTPrimed;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = EntityTinyTNTPrimed.class, remap = false)
public abstract class MixinEntityTinyTNTPrimed extends EntityTNTPrimed {
public MixinEntityTinyTNTPrimed(String string) {
super(null);
throw new RuntimeException("This should never run!");
}
/**
* @author Rehab_CZ
* @reason Replaced with default explosions (GPP can catch this)
*/
@Overwrite
void explode() {
// Still respect configs tho
if (AEConfig.instance.isFeatureEnabled(AEFeature.TinyTNTBlockDamage)) {
this.posY -= 0.25;
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.3f, true).exploder = this;
}
}
}
| 1,009 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPlatform.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-AppliedEnergistics/src/main/java/io/github/crucible/grimoire/mixins/appliedenergistics/MixinPlatform.java | package io.github.crucible.grimoire.mixins.appliedenergistics;
import appeng.util.Platform;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.security.InvalidParameterException;
import java.util.UUID;
import java.util.WeakHashMap;
@Mixin(value = Platform.class, remap = false)
public abstract class MixinPlatform {
@Shadow
@Final
private static final WeakHashMap<World, EntityPlayer> FAKE_PLAYERS = new WeakHashMap<World, EntityPlayer>();
/**
* @author Rehab_CZ
* @reason Change FakePlayer instead of [Minecraft] to [AppliedEnergistics]
*/
@Overwrite
public static EntityPlayer getPlayer(final WorldServer w )
{
if( w == null )
{
throw new InvalidParameterException( "World is null." );
}
final EntityPlayer wrp = FAKE_PLAYERS.get( w );
if( wrp != null )
{
return wrp;
}
GameProfile AE2Profile = new GameProfile(UUID.nameUUIDFromBytes("[AppliedEnergistics]".getBytes()), "[AppliedEnergistics]");
final EntityPlayer p = FakePlayerFactory.get(w,AE2Profile);
FAKE_PLAYERS.put( w, p );
return p;
}
}
| 1,519 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
PaintingMachineSlot.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/data/enderio/slot/PaintingMachineSlot.java | package io.github.crucible.grimoire.data.enderio.slot;
import crazypants.enderio.machine.gui.AbstractMachineContainer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class PaintingMachineSlot extends Slot {
protected final AbstractMachineContainer machineContainer;
protected PaintingMachineSlot(AbstractMachineContainer machineContainer, int slot, int xDisplayPosition, int yDisplayPosition) {
super(machineContainer.getInv(), slot, xDisplayPosition, xDisplayPosition);
this.machineContainer = machineContainer;
}
public static class DISPLAY extends PaintingMachineSlot{
public DISPLAY(AbstractMachineContainer machineContainer, int slot, int xDisplayPosition, int yDisplayPosition) {
super(machineContainer, slot, xDisplayPosition, yDisplayPosition);
}
@Override
public boolean isItemValid(ItemStack itemStack) {
return false;
}
}
public static class INPUT extends PaintingMachineSlot{
public INPUT(AbstractMachineContainer machineContainer, int slot, int xDisplayPosition, int yDisplayPosition) {
super(machineContainer, slot, xDisplayPosition, yDisplayPosition);
}
@Override
public boolean isItemValid(ItemStack itemStack) {
return !itemStack.hasTagCompound() && machineContainer.getInv().isItemValidForSlot(this.getSlotIndex(), itemStack);
}
}
}
| 1,465 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketConnectionMode.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketConnectionMode.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketConnectionMode;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketConnectionMode.class, remap = false)
public abstract class MixinPacketConnectionMode {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketConnectionMode message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
ci.cancel();
}
} catch (Exception e) {
ci.setReturnValue(null);
ci.cancel();
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,636 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketRedstoneConduitOutputStrength.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketRedstoneConduitOutputStrength.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketRedstoneConduitOutputStrength;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketRedstoneConduitOutputStrength.class, remap = false)
public abstract class MixinPacketRedstoneConduitOutputStrength {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketRedstoneConduitOutputStrength message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
}
} catch (Exception e) {
ci.setReturnValue(null);
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,642 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEnchantmentSoulBound.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinEnchantmentSoulBound.java | package io.github.crucible.grimoire.mixins.enderio;
import crazypants.enderio.enchantment.EnchantmentSoulBound;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnumEnchantmentType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
// TODO: 17/10/2019 Remover esse mixin e fazer um check na bigorna.
@Mixin(EnchantmentSoulBound.class)
public abstract class MixinEnchantmentSoulBound extends Enchantment {
private MixinEnchantmentSoulBound() {
super(1, 1, EnumEnchantmentType.breakable);
}
@Inject(method = "<init>", at = @At("RETURN"))
private void onInit(int id, CallbackInfo callbackInfo) {
this.type = EnumEnchantmentType.breakable;
}
}
| 873 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketOCConduitSignalColor.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketOCConduitSignalColor.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketOCConduitSignalColor;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketOCConduitSignalColor.class, remap = false)
public abstract class MixinPacketOCConduitSignalColor {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketOCConduitSignalColor message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
}
} catch (Exception e) {
ci.setReturnValue(null);
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,605 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPainterContainer.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPainterContainer.java | package io.github.crucible.grimoire.mixins.enderio;
import crazypants.enderio.machine.gui.AbstractMachineContainer;
import crazypants.enderio.machine.painter.PainterContainer;
import crazypants.enderio.machine.painter.TileEntityPainter;
import io.github.crucible.grimoire.data.enderio.slot.PaintingMachineSlot;
import net.minecraft.entity.player.InventoryPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(value = PainterContainer.class, remap = false)
public abstract class MixinPainterContainer extends AbstractMachineContainer<TileEntityPainter> {
private MixinPainterContainer() {
super(null, null);
throw new RuntimeException("This should neve Run!");
}
/**
* @author evernife
*
* Fix a dupe by not allowing any item that has any NBT
* to be used as a template for the facede
*/
@Overwrite
protected void addMachineSlots(InventoryPlayer playerInv) {
addSlotToContainer(new PaintingMachineSlot.INPUT(this, 0, 67, 34));
addSlotToContainer(new PaintingMachineSlot.INPUT(this, 1, 38, 34));
addSlotToContainer(new PaintingMachineSlot.DISPLAY(this, 2, 121, 34));
}
}
| 1,211 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketTravelEvent.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketTravelEvent.java | package io.github.crucible.grimoire.mixins.enderio;
import crazypants.enderio.api.teleport.TravelSource;
import crazypants.enderio.teleport.packet.PacketTravelEvent;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(value = PacketTravelEvent.class, remap = false)
public abstract class MixinPacketTravelEvent {
/**
* @author evernife
* @reason Disable teleport if entity is more than 250 blocks away from the target
*/
@Inject(method = "doServerTeleport", at = @At("HEAD"), cancellable = true)
private static void doServerTeleport(Entity toTp, int x, int y, int z, int powerUse, boolean conserveMotion, TravelSource source, CallbackInfoReturnable<Boolean> cir) {
int xOrigin = MathHelper.floor_double(toTp.posX);
int zOrigin = MathHelper.floor_double(toTp.posZ);
int squareDistance = (z - zOrigin) * (z - zOrigin) + (x - xOrigin) * (x - xOrigin);
if (squareDistance >= 122500){ //sqrt(122500) == 350
cir.setReturnValue(true);
return;
}
}
}
| 1,294 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketItemConduitFilter.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketItemConduitFilter.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketItemConduitFilter;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketItemConduitFilter.class, remap = false)
public abstract class MixinPacketItemConduitFilter {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketItemConduitFilter message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
ci.cancel();
}
} catch (Exception e) {
ci.setReturnValue(null);
ci.cancel();
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,648 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketExtractMode.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketExtractMode.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketExtractMode;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketExtractMode.class, remap = false)
public abstract class MixinPacketExtractMode {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketExtractMode message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
ci.cancel();
}
} catch (Exception e) {
ci.setReturnValue(null);
ci.cancel();
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,624 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketRedstoneConduitSignalColor.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketRedstoneConduitSignalColor.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.packet.PacketRedstoneConduitSignalColor;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.reflect.Field;
@Mixin(value = PacketRedstoneConduitSignalColor.class, remap = false)
public abstract class MixinPacketRedstoneConduitSignalColor {
@Inject(method = "onMessage", at = @At("HEAD"), cancellable = true)
private void onMessage(PacketRedstoneConduitSignalColor message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci) {
try {
EntityPlayer entityPlayer = ctx.getServerHandler().playerEntity;
int x = getValue(message, "x");
int y = getValue(message, "y");
int z = getValue(message, "z");
if (EventUtils.cantBreak(entityPlayer, x, y, z)) {
ci.setReturnValue(null);
}
} catch (Exception e) {
ci.setReturnValue(null);
}
}
private int getValue(Object target, String targetField) throws NoSuchFieldException, IllegalAccessException {
Field field = target.getClass().getDeclaredField(targetField);
field.setAccessible(true);
return (int) field.get(target);
}
}
| 1,630 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketGivePlayerXP.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-EnderIO/src/main/java/io/github/crucible/grimoire/mixins/enderio/MixinPacketGivePlayerXP.java | package io.github.crucible.grimoire.mixins.enderio;
import com.gamerforea.eventhelper.util.EventUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.xp.IHaveExperience;
import crazypants.enderio.xp.PacketGivePlayerXP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(value = PacketGivePlayerXP.class, remap = false)
public abstract class MixinPacketGivePlayerXP {
@Inject(method = "onMessage", at = @At(target = "Lcrazypants/enderio/xp/IHaveExperience;getContainer()Lcrazypants/enderio/xp/ExperienceContainer;", value = "INVOKE"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
private void beforeGiveXp(PacketGivePlayerXP message, MessageContext ctx, CallbackInfoReturnable<IMessage> ci, EntityPlayer player, TileEntity tile, IHaveExperience xpTile) {
if (EventUtils.cantBreak(player, tile.xCoord, tile.yCoord, tile.zCoord)) ci.setReturnValue(null);
}
}
| 1,330 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinRenderItem.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/mixins/forge/MixinRenderItem.java | package io.github.crucible.grimoire.mixins.forge;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(RenderItem.class)
public abstract class MixinRenderItem {
@Shadow
public boolean renderWithColor;
@Shadow
public float zLevel;
@Shadow
private RenderBlocks renderBlocksRi;
@Shadow
public abstract void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_);
@Shadow
public abstract void renderEffect(TextureManager manager, int x, int y);
/**
* @author juanmuscaria
*/
@Overwrite(remap = false)
@Debug(print = true)
public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_, boolean renderEffect) {
try {
int k = p_77015_3_.getItemDamage();
Object object = p_77015_3_.getIconIndex();
int l;
float f;
float f3;
float f4;
if (p_77015_3_.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(p_77015_3_.getItem()).getRenderType())) {
p_77015_2_.bindTexture(TextureMap.locationBlocksTexture);
Block block = Block.getBlockFromItem(p_77015_3_.getItem());
GL11.glEnable(3008);
if (block.getRenderBlockPass() != 0) {
GL11.glAlphaFunc(516, 0.1F);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
} else {
GL11.glAlphaFunc(516, 0.5F);
GL11.glDisable(3042);
}
GL11.glPushMatrix();
GL11.glTranslatef((float) (p_77015_4_ - 2), (float) (p_77015_5_ + 3), -3.0F + this.zLevel);
GL11.glScalef(10.0F, 10.0F, 10.0F);
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
GL11.glScalef(1.0F, 1.0F, -1.0F);
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0);
f3 = (float) (l >> 16 & 255) / 255.0F;
f4 = (float) (l >> 8 & 255) / 255.0F;
f = (float) (l & 255) / 255.0F;
if (this.renderWithColor) {
GL11.glColor4f(f3, f4, f, 1.0F);
}
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
this.renderBlocksRi.useInventoryTint = this.renderWithColor;
this.renderBlocksRi.renderBlockAsItem(block, k, 1.0F);
this.renderBlocksRi.useInventoryTint = true;
if (block.getRenderBlockPass() == 0) {
GL11.glAlphaFunc(516, 0.1F);
}
GL11.glPopMatrix();
} else if (p_77015_3_.getItem().requiresMultipleRenderPasses()) {
GL11.glDisable(2896);
GL11.glEnable(3008);
p_77015_2_.bindTexture(TextureMap.locationItemsTexture);
GL11.glDisable(3008);
GL11.glDisable(3553);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(0, 0, 0, 0);
GL11.glColorMask(false, false, false, true);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(-1);
tessellator.addVertex(p_77015_4_ - 2, p_77015_5_ + 18, this.zLevel);
tessellator.addVertex(p_77015_4_ + 18, p_77015_5_ + 18, this.zLevel);
tessellator.addVertex(p_77015_4_ + 18, p_77015_5_ - 2, this.zLevel);
tessellator.addVertex(p_77015_4_ - 2, p_77015_5_ - 2, this.zLevel);
tessellator.draw();
GL11.glColorMask(true, true, true, true);
GL11.glEnable(3553);
GL11.glEnable(3008);
Item item = p_77015_3_.getItem();
for (l = 0; l < item.getRenderPasses(k); ++l) {
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
p_77015_2_.bindTexture(item.getSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
IIcon iicon = item.getIcon(p_77015_3_, l);
int i1 = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, l);
f = (float) (i1 >> 16 & 255) / 255.0F;
float f1 = (float) (i1 >> 8 & 255) / 255.0F;
float f2 = (float) (i1 & 255) / 255.0F;
if (this.renderWithColor) {
GL11.glColor4f(f, f1, f2, 1.0F);
}
GL11.glDisable(2896);
GL11.glEnable(3008);
this.renderIcon(p_77015_4_, p_77015_5_, iicon, 16, 16);
GL11.glDisable(3008);
GL11.glEnable(2896);
if (renderEffect && p_77015_3_.hasEffect(l)) {
this.renderEffect(p_77015_2_, p_77015_4_, p_77015_5_);
}
}
GL11.glEnable(2896);
} else {
GL11.glDisable(2896);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
ResourceLocation resourcelocation = p_77015_2_.getResourceLocation(p_77015_3_.getItemSpriteNumber());
p_77015_2_.bindTexture(resourcelocation);
if (object == null) {
object = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
}
l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0);
f3 = (float) (l >> 16 & 255) / 255.0F;
f4 = (float) (l >> 8 & 255) / 255.0F;
f = (float) (l & 255) / 255.0F;
if (this.renderWithColor) {
GL11.glColor4f(f3, f4, f, 1.0F);
}
GL11.glDisable(2896);
GL11.glEnable(3008);
GL11.glEnable(3042);
this.renderIcon(p_77015_4_, p_77015_5_, (IIcon) object, 16, 16);
GL11.glEnable(2896);
GL11.glDisable(3008);
GL11.glDisable(3042);
if (renderEffect && p_77015_3_.hasEffect(0)) {
this.renderEffect(p_77015_2_, p_77015_4_, p_77015_5_);
}
GL11.glEnable(2896);
}
GL11.glEnable(2884);
} catch (Exception ignore) {
}
}
}
| 7,529 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinItemStack.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/mixins/forge/MixinItemStack.java | package io.github.crucible.grimoire.mixins.forge;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@SuppressWarnings("ConstantConditions")
@Mixin(ItemStack.class)
public abstract class MixinItemStack {
@Shadow
public abstract Item getItem();
/**
* @author juanmuscaria
*/
@SideOnly(Side.CLIENT)
@Debug(print = true)
@Overwrite
public IIcon getIconIndex() {
try {
Object self = this;
return this.getItem().getIconIndex((ItemStack) self);
} catch (Exception e) {
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationItemsTexture)).getAtlasSprite("missingno");
}
}
}
| 1,114 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileEntity.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/mixins/forge/MixinTileEntity.java | package io.github.crucible.grimoire.mixins.forge;
import io.github.crucible.grimoire.forge.core.FakePlayerManager;
import io.github.crucible.grimoire.forge.core.ITileEntity;
import io.github.crucible.grimoire.forge.core.UserIdent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TileEntity.class)
public abstract class MixinTileEntity implements ITileEntity {
private UserIdent tileOwner = UserIdent.nobody;
@Shadow
public abstract World getWorldObj();
@Override
public UserIdent getUserIdent() {
return tileOwner;
}
public void setUserIdent(UserIdent ident) {
tileOwner = ident;
}
@Override
public EntityPlayer getFakePlayer() {
if (tileOwner.equals(UserIdent.nobody)) {
return FakePlayerManager.get((WorldServer) getWorldObj());
} else {
return FakePlayerManager.get((WorldServer) getWorldObj(), tileOwner);
}
}
@Inject(method = "readFromNBT", at = @At("HEAD"))
private void readInject(NBTTagCompound nbtTagCompound, CallbackInfo callback) {
if (UserIdent.existsInNbt(nbtTagCompound, "crucibledata.owner"))
tileOwner = UserIdent.readfromNbt(nbtTagCompound, "crucibledata.owner");
else tileOwner = UserIdent.nobody;
}
@Inject(method = "writeToNBT", at = @At("HEAD"))
private void writeInject(NBTTagCompound nbtTagCompound, CallbackInfo callback) {
tileOwner.saveToNbt(nbtTagCompound, "crucibledata.owner");
}
}
| 1,914 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinRenderManager.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/mixins/forge/MixinRenderManager.java | package io.github.crucible.grimoire.mixins.forge;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(RenderManager.class)
public abstract class MixinRenderManager {
@Shadow
public static boolean debugBoundingBox;
@Shadow
public TextureManager renderEngine;
@Shadow
protected abstract void renderDebugBoundingBox(Entity p_85094_1_, double p_85094_2_, double p_renderDebugBoundingBox_4_, double p_85094_4_, float p_renderDebugBoundingBox_8_, float p_85094_6_);
@Shadow
public abstract Render getEntityRenderObject(Entity p_78713_1_);
/**
* @author juanmuscaria
* @reason Evitar crashar ao reiderizar uma entidade.
*/
@Overwrite
@Debug(print = true)
public boolean func_147939_a(Entity p_147939_1_, double p_147939_2_, double p_147939_4_, double p_147939_6_, float p_147939_8_, float p_147939_9_, boolean p_147939_10_) {
Render render = null;
try {
render = this.getEntityRenderObject(p_147939_1_);
if (render != null && this.renderEngine != null) {
if (!render.isStaticEntity() || p_147939_10_) {
try {
render.doRender(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_);
} catch (Throwable var18) {
//System.out.println(CrashReport.makeCrashReport(var18, "Rendering entity in world").getCompleteReport());
}
try {
render.doRenderShadowAndFire(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_);
} catch (Throwable var17) {
//System.out.println(CrashReport.makeCrashReport(var17, "Post-rendering entity in world").getCompleteReport());
}
if (debugBoundingBox && !p_147939_1_.isInvisible() && !p_147939_10_) {
try {
this.renderDebugBoundingBox(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_);
} catch (Throwable var16) {
//System.out.println(CrashReport.makeCrashReport(var16, "Rendering entity hitbox in world").getCompleteReport());
}
}
}
} else return this.renderEngine == null;
return true;
} catch (Throwable var19) {
CrashReport crashreport = CrashReport.makeCrashReport(var19, "Rendering entity in world");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being rendered");
p_147939_1_.addEntityCrashInfo(crashreportcategory);
CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Renderer details");
crashreportcategory1.addCrashSection("Assigned renderer", render);
crashreportcategory1.addCrashSection("Location", CrashReportCategory.func_85074_a(p_147939_2_, p_147939_4_, p_147939_6_));
crashreportcategory1.addCrashSection("Rotation", p_147939_8_);
crashreportcategory1.addCrashSection("Delta", p_147939_9_);
// System.out.println(crashreport.getCompleteReport());
return false;
}
}
}
| 3,736 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinEntityThrowable.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/mixins/forge/MixinEntityThrowable.java | package io.github.crucible.grimoire.mixins.forge;
import io.github.crucible.grimoire.forge.core.IThrowableHook;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(EntityThrowable.class)
public abstract class MixinEntityThrowable implements IThrowableHook {
@Shadow
private EntityLivingBase thrower;
@Override
public void setThrower(EntityLivingBase player) {
thrower = player;
}
}
| 556 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
Function.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/Function.java | package io.github.crucible.grimoire.forge.core;
/**
* Abstraction for some simple cache calls.
*
* @author Jikoo
*/
public abstract class Function<V> {
public abstract boolean run(V value);
} | 202 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
Cache.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/Cache.java | package io.github.crucible.grimoire.forge.core;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multimap;
import com.google.common.collect.TreeMultimap;
import java.util.*;
/**
* A minimal thread-safe time-based cache implementation backed by a HashMap and TreeMultimap.
*
* @author Jikoo
*/
public class Cache<K, V> {
private final Map<K, V> internal;
private final Multimap<Long, K> expiry;
private final long retention;
private final Function<V> inUseCheck, postRemoval;
/**
* Constructs a Cache with the specified retention duration, in use function, and post-removal function.
*
* @param retention duration after which keys are automatically invalidated if not in use
* @param inUseCheck Function used to check if a key is considered in use
* @param postRemoval Function used to perform any operations required when a key is invalidated
*/
public Cache(final long retention, final Function<V> inUseCheck, final Function<V> postRemoval) {
this.internal = new HashMap<K, V>();
this.expiry = TreeMultimap.create(Long::compareTo,
(k1, k2) -> Objects.equals(k1, k2) ? 0 : 1);
this.retention = retention;
this.inUseCheck = inUseCheck;
this.postRemoval = postRemoval;
}
/**
* Set a key and value pair. Keys are unique. Using an existing key will cause the old value to
* be overwritten and the expiration timer to be reset.
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
*/
public void put(final K key, final V value) {
// Invalidate key - runs lazy check and ensures value won't be cleaned up early
this.invalidate(key);
synchronized (this.internal) {
this.internal.put(key, value);
this.expiry.put(System.currentTimeMillis() + this.retention, key);
}
}
/**
* Returns the value to which the specified key is mapped, or null if no value is mapped for the key.
*
* @param key the key whose associated value is to be returned
* @return the value to which the specified key is mapped, or null if no value is mapped for the key
*/
public V get(final K key) {
// Run lazy check to clean cache
this.lazyCheck();
synchronized (this.internal) {
return this.internal.get(key);
}
}
/**
* Returns true if the specified key is mapped to a value.
*
* @param key key to check if a mapping exists for
* @return true if a mapping exists for the specified key
*/
public boolean containsKey(final K key) {
// Run lazy check to clean cache
this.lazyCheck();
synchronized (this.internal) {
return this.internal.containsKey(key);
}
}
/**
* Forcibly invalidates a key, even if it is considered to be in use.
*
* @param key key to invalidate
*/
public void invalidate(final K key) {
// Run lazy check to clean cache
this.lazyCheck();
synchronized (this.internal) {
if (!this.internal.containsKey(key)) {
// Value either not present or cleaned by lazy check. Either way, we're good
return;
}
// Remove stored object
this.internal.remove(key);
// Remove expiration entry - prevents more work later, plus prevents issues with values invalidating early
for (Iterator<Map.Entry<Long, K>> iterator = this.expiry.entries().iterator(); iterator.hasNext(); ) {
if (key.equals(iterator.next().getValue())) {
iterator.remove();
break;
}
}
}
}
/**
* Forcibly invalidates all keys, even if they are considered to be in use.
*/
public void invalidateAll() {
synchronized (this.internal) {
for (V value : this.internal.values()) {
this.postRemoval.run(value);
}
this.expiry.clear();
this.internal.clear();
}
}
/**
* Invalidate all expired keys that are not considered in use. If a key is expired but is
* considered in use by the provided Function, its expiration time is reset.
*/
private void lazyCheck() {
long now = System.currentTimeMillis();
synchronized (this.internal) {
List<K> inUse = new ArrayList<K>();
for (Iterator<Map.Entry<Long, K>> iterator = this.expiry.entries().iterator(); iterator
.hasNext(); ) {
Map.Entry<Long, K> entry = iterator.next();
if (entry.getKey() > now) {
break;
}
iterator.remove();
if (this.inUseCheck.run(this.internal.get(entry.getValue()))) {
inUse.add(entry.getValue());
continue;
}
V value = this.internal.remove(entry.getValue());
if (value == null) {
continue;
}
this.postRemoval.run(value);
}
long nextExpiry = now + this.retention;
for (K value : inUse) {
this.expiry.put(nextExpiry, value);
}
}
}
public Map<K, V> getInternal() {
return ImmutableMap.copyOf(internal);
}
} | 5,574 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
UuidUtils.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/UuidUtils.java | package io.github.crucible.grimoire.forge.core;
import com.google.common.annotations.Beta;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
/**
* A set of functions to help deal with UUIDs.
*
* @author juanmuscaria
*/
public final class UuidUtils {
//Seal class.
private UuidUtils() {
}
/**
* Generate a player offline UUID.
*
* @param playerName The player's name.
* @return An offline player UUID.
*/
@NotNull
public static UUID offlineUUID(String playerName) {
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(StandardCharsets.UTF_8));
}
/**
* Process a string to try to get a uuid from it.
*
* @param uuid A string to process.
* @return The UUID found in the string, null if no UUID is found.
*/
@Nullable
public static UUID processUuidString(String uuid) {
try {
return UUID.fromString(uuid);
} catch (Exception ignore) {
}
try {
String processedUuid = uuid.substring(0, 8) +
"-" + uuid.substring(8, 12) +
"-" + uuid.substring(12, 16) +
"-" + uuid.substring(16, 20) +
"-" + uuid.substring(20, 32);
return UUID.fromString(processedUuid);
} catch (Exception ignored) {
}
return null;
}
/**
* Get a player's UUID from Mojang's api.
* Caching is recommended.
*
* @param playerName The player's name.
* @return The player's UUID, null if it was not possible to get the UUID.
*/
@Beta
@Nullable
public UUID onlineUUID(String playerName) {
try {
URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + playerName);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setConnectTimeout(5000);
con.setReadTimeout(5000);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder content = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
in.close();
JsonParser parser = new JsonParser();
JsonElement element = parser.parse(content.toString());
if (!element.isJsonObject()) return null;
String unprocessedUuid = element.getAsJsonObject().get("id").getAsString();
return processUuidString(unprocessedUuid);
} catch (Exception ignored) {
}
return null;
}
}
| 2,986 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
ITileEntity.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/ITileEntity.java | package io.github.crucible.grimoire.forge.core;
import net.minecraft.entity.player.EntityPlayer;
public interface ITileEntity {
UserIdent getUserIdent();
void setUserIdent(UserIdent ident);
EntityPlayer getFakePlayer();
}
| 238 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
FeatherFakePlayer.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/FeatherFakePlayer.java | package io.github.crucible.grimoire.forge.core;
import com.mojang.authlib.GameProfile;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
import java.util.UUID;
@SuppressWarnings("EntityConstructor")
public class FeatherFakePlayer extends FakePlayer {
private final UserIdent owner;
FeatherFakePlayer(WorldServer world, GameProfile name, String owner) {
super(world, name);
this.owner = UserIdent.create((UUID) null, owner);
}
FeatherFakePlayer(WorldServer world, GameProfile name, UserIdent owner) {
super(world, name);
this.owner = owner;
}
public UserIdent getOwner() {
return owner;
}
}
| 704 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
IThrowableHook.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/IThrowableHook.java | package io.github.crucible.grimoire.forge.core;
import net.minecraft.entity.EntityLivingBase;
public interface IThrowableHook {
void setThrower(EntityLivingBase player);
}
| 178 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
EmptyFunction.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/EmptyFunction.java | package io.github.crucible.grimoire.forge.core;
/**
* Use this function to save some lines when not using cache calls.
*
* @author juanmuscaria
*/
public final class EmptyFunction<V> extends Function<V> {
@Override
public boolean run(V value) {
return false;
}
}
| 288 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
FakePlayerManager.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/FakePlayerManager.java | package io.github.crucible.grimoire.forge.core;
import com.mojang.authlib.GameProfile;
import net.minecraft.world.WorldServer;
import java.lang.ref.SoftReference;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
public class FakePlayerManager {
private static final GameProfile featherModProfile = new GameProfile(offlineUuidFromName("[FeatherMod]"), "[FeatherMod]");
private static SoftReference<FeatherFakePlayer> featherModFakePlayer = new SoftReference<>(null);
private static final Cache<String, SoftReference<FeatherFakePlayer>> fakePlayerCache = new Cache<>(6000L, new Function<SoftReference<FeatherFakePlayer>>() {
@Override
public boolean run(SoftReference<FeatherFakePlayer> value) {
return value.get() != null;
}
}, new EmptyFunction<>());
public static FeatherFakePlayer get(WorldServer world, String name) {
SoftReference<FeatherFakePlayer> reference = fakePlayerCache.get(name);
if (reference == null || reference.get() == null) {
String fName = "[" + name + "]";
GameProfile profile = new GameProfile(offlineUuidFromName(fName), fName);
FeatherFakePlayer player = new FeatherFakePlayer(world, profile, name);
reference = new SoftReference<FeatherFakePlayer>(player);
}
FeatherFakePlayer fakePlayer = reference.get();
assert fakePlayer != null;
fakePlayer.worldObj = world;
return fakePlayer;
}
public static FeatherFakePlayer get(WorldServer world, UserIdent name) {
SoftReference<FeatherFakePlayer> reference = fakePlayerCache.get(name.getPlayerName());
if (reference == null || reference.get() == null) {
String fName = "[" + name.getPlayerName() + "]";
GameProfile profile = new GameProfile(offlineUuidFromName(fName), fName);
FeatherFakePlayer player = new FeatherFakePlayer(world, profile, name);
reference = new SoftReference<FeatherFakePlayer>(player);
}
FeatherFakePlayer fakePlayer = reference.get();
assert fakePlayer != null;
fakePlayer.worldObj = world;
return fakePlayer;
}
public static FeatherFakePlayer get(WorldServer world) {
FeatherFakePlayer player = featherModFakePlayer.get();
if (player == null) {
player = new FeatherFakePlayer(world, featherModProfile, "");
featherModFakePlayer = new SoftReference<>(player);
}
player.worldObj = world;
return player;
}
private static UUID offlineUuidFromName(String name) {
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(StandardCharsets.UTF_8));
}
}
| 2,731 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
UserIdent.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Forge/src/main/java/io/github/crucible/grimoire/forge/core/UserIdent.java | package io.github.crucible.grimoire.forge.core;
import com.google.common.base.Charsets;
import com.mojang.authlib.GameProfile;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.UsernameCache;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.UUID;
public class UserIdent {
private static final String NONE_MARKER = "none";
private final @Nullable UUID uuid;
private final @Nonnull UUID uuid_offline;
private final @Nonnull String playerName;
public @Nonnull String getPlayerName() {
if (uuid != null) {
String lastKnownName = UsernameCache.getLastKnownUsername(uuid);
if (lastKnownName != null) {
return lastKnownName;
}
}
return playerName;
}
public UUID getUUID() {
return uuid != null ? uuid : uuid_offline;
}
public String getUUIDString() {
return uuid != null ? uuid.toString() : NONE_MARKER;
}
/**
* Create a UserIdent from a UUID object and a name. Use this when reading
* stored data, it will check for username changes, implement them and write a
* log message.
*/
public static @Nonnull UserIdent create(@Nullable UUID uuid, @Nullable String playerName) {
if (uuid != null) {
if (nobody.equals(uuid)) {
return nobody;
}
if (playerName != null) {
String lastKnownName = UsernameCache.getLastKnownUsername(uuid);
if (lastKnownName != null && !lastKnownName.equals(playerName)) {
System.out.println("The user with the UUID " + uuid + " changed name from '" + playerName + "' to '" + lastKnownName + "'");
return new UserIdent(uuid, lastKnownName);
}
}
return new UserIdent(uuid, playerName);
} else if (playerName != null) {
return new UserIdent(null, playerName);
} else {
return nobody;
}
}
/**
* Create a UserIdent from a UUID string and a name. Use this when reading
* stored data, it will check for username changes, implement them and write a
* log message.
*/
public static @Nonnull UserIdent create(@Nonnull String suuid, @Nullable String playerName) {
if (NONE_MARKER.equals(suuid)) {
return new UserIdent(null, playerName);
}
try {
UUID uuid = UUID.fromString(suuid);
if (nobody.equals(uuid)) {
return nobody;
}
return create(uuid, playerName);
} catch (IllegalArgumentException e) {
return nobody;
}
}
/**
* Create a UserIdent from a legacy string. The string can either be a UUID or
* a player name. Use this when reading legacy data or user configured values.
*/
public static @Nonnull UserIdent create(@Nullable String legacyData) {
UUID uuid = getPlayerUIDUnstable(legacyData);
if (uuid != null) {
return new UserIdent(uuid, legacyData);
} else if (legacyData != null) {
return new UserIdent(null, legacyData);
} else {
return nobody;
}
}
/**
* Create a UserIdent from a GameProfile. Use this when creating a UserIdent
* for a currently active player.
*/
public static @Nonnull UserIdent create(@Nullable GameProfile gameProfile) {
if (gameProfile != null && (gameProfile.getId() != null || gameProfile.getName() != null)) {
if (gameProfile.getId() != null && gameProfile.getName() != null
&& gameProfile.getId().equals(offlineUUID(gameProfile.getName()))) {
return new UserIdent(null, gameProfile.getName());
} else {
return new UserIdent(gameProfile.getId(), gameProfile.getName());
}
} else {
return nobody;
}
}
private static @Nonnull UUID offlineUUID(String playerName) {
UUID result = UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(Charsets.UTF_8));
return result != null ? result : new UUID(-1, -1);
}
private UserIdent(UUID uuid, String playerName) {
this.uuid = uuid;
this.uuid_offline = offlineUUID(playerName);
this.playerName = playerName != null ? playerName : "[" + uuid + "]";
}
@SuppressWarnings("null")
// it's final(!), eclipse...
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + playerName.hashCode();
result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
return result;
}
/**
* Please note that a UserIdent will successfully equal against GameProfiles
* and UUIDs.
*/
@SuppressWarnings("null")
// it's final(!), eclipse...
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof UserIdent) {
UserIdent other = (UserIdent) obj;
if (this.uuid != null && other.uuid != null) {
return this.uuid.equals(other.uuid);
}
return this.uuid_offline.equals(other.uuid_offline);
} else if (obj instanceof GameProfile) {
GameProfile other = (GameProfile) obj;
UUID other_uuid = other.getId();
if (this.uuid != null && other_uuid != null) {
return this.uuid.equals(other_uuid);
}
UUID uuid_offline_other = offlineUUID(other.getName());
return uuid_offline_other.equals(this.uuid) || this.uuid_offline.equals(uuid_offline_other);
} else if (obj instanceof UUID) {
return obj.equals(uuid) || obj.equals(uuid_offline);
}
return false;
}
@SuppressWarnings("null")
// it's final(!), eclipse...
public void saveToNbt(NBTTagCompound nbt, String prefix) {
if (uuid != null) {
nbt.setString(prefix + ".uuid", uuid.toString());
}
nbt.setString(prefix + ".login", playerName);
}
public static boolean existsInNbt(NBTTagCompound nbt, String prefix) {
return nbt.hasKey(prefix + ".uuid") || nbt.hasKey(prefix + ".login");
}
public static @Nonnull UserIdent readfromNbt(NBTTagCompound nbt, String prefix) {
String suuid = nbt.getString(prefix + ".uuid");
String login = nbt.getString(prefix + ".login");
if (Nobody.NOBODY_MARKER.equals(suuid)) {
return nobody;
}
try {
UUID uuid = UUID.fromString(suuid);
return create(uuid, login);
} catch (IllegalArgumentException e) {
if (login != null && !login.isEmpty()) {
return new UserIdent(null, login);
} else {
return nobody;
}
}
}
@Override
public String toString() {
return "User [uuid=" + (uuid != null ? uuid : "(unknown)") + ", name=" + playerName + "]";
}
public static final @Nonnull Nobody nobody = new Nobody();
private static class Nobody extends UserIdent {
private static final String NOBODY_MARKER = "nobody";
private Nobody() {
super(null, "[unknown player]");
}
@Override
public boolean equals(Object obj) {
return this == obj;
}
@Override
public void saveToNbt(NBTTagCompound nbt, String prefix) {
nbt.setString(prefix + ".uuid", NOBODY_MARKER);
}
}
public static UUID getPlayerUUID(String username) {
for (Map.Entry<UUID, String> entry : UsernameCache.getMap().entrySet()) {
if (entry.getValue().equalsIgnoreCase(username)) {
return entry.getKey();
}
}
return null;
}
public static UUID getPlayerUIDUnstable(String possibleUUID) {
if (possibleUUID == null || possibleUUID.isEmpty())
return null;
UUID uuid = null;
try {
uuid = UUID.fromString(possibleUUID);
} catch (IllegalArgumentException e) {
uuid = getPlayerUUID(possibleUUID);
}
return uuid;
}
} | 8,382 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinNEIServerUtils.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-NEI/src/main/java/io/github/crucible/grimoire/mixins/nei/MixinNEIServerUtils.java | package io.github.crucible.grimoire.mixins.nei;
import codechicken.lib.packet.PacketCustom;
import codechicken.nei.*;
import com.gamerforea.eventhelper.util.EventUtils;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.WorldSettings;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
/**
* Created by EverNife on 22/08/2019.
*/
@Mixin(value = NEIServerUtils.class, remap = false)
public abstract class MixinNEIServerUtils {
@Shadow
public static WorldSettings.GameType getGameType(int mode) {
return null;
}
/**
* @author EverNife
* @reason Previnir hackers que acabam burlando o sistema de packets!
*
* Adicionado a permissão "nei.gamemode" para validar o processo!
*/
@Overwrite
public static void setGamemode(EntityPlayerMP player, int mode) {
if (mode < 0 || mode >= NEIActions.gameModes.length ||
NEIActions.nameActionMap.containsKey(NEIActions.gameModes[mode]) &&
!NEIServerConfig.canPlayerPerformAction(player.getCommandSenderName(), NEIActions.gameModes[mode]))
return;
//creative+
NEIServerConfig.forPlayer(player.getCommandSenderName()).enableAction("creative+", mode == 2);
if(mode == 2 && !(player.openContainer instanceof ContainerCreativeInv))//open the container immediately for the client
NEISPH.processCreativeInv(player, true);
//change it on the server
WorldSettings.GameType newGamemode = getGameType(mode);
NEIServerConfig.logger.info("[NEI] Changing player " + player.getCommandSenderName() + " gamemode to [" + newGamemode + "]");
MinecraftServer.getServer().getCommandManager().executeCommand(player, "gamemode " + newGamemode);
if (EventUtils.hasPermission(player,"nei.gamemode")){
player.theItemInWorldManager.setGameType(newGamemode);
//tell the client to change it
(new PacketCustom("NEI", 14)).writeByte(mode).sendToPlayer(player);
player.addChatMessage(new ChatComponentText("§aGamemode alterado para [" + newGamemode.getName() + "]"));
}
}
} | 2,338 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketEnrichPlant.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-CarpentersBlocks/src/main/java/io/github/crucible/grimoire/mixins/carpentersblocks/MixinPacketEnrichPlant.java | package io.github.crucible.grimoire.mixins.carpentersblocks;
import com.carpentersblocks.network.PacketEnrichPlant;
import com.carpentersblocks.network.TilePacket;
import com.carpentersblocks.tileentity.TECarpentersFlowerPot;
import com.gamerforea.eventhelper.util.EventUtils;
import io.netty.buffer.ByteBufInputStream;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.io.IOException;
@Mixin(value = PacketEnrichPlant.class, remap = false)
public class MixinPacketEnrichPlant extends TilePacket {
@Shadow
private int hexColor;
/**
* @author juanmuscaria
* @reason Possível fix para um hack.
*/
@Overwrite
public void processData(EntityPlayer entityPlayer, ByteBufInputStream bbis) throws IOException {
super.processData(entityPlayer, bbis);
World world = entityPlayer.worldObj;
hexColor = bbis.readInt();
if (EventUtils.cantInteract(entityPlayer, entityPlayer.getCurrentEquippedItem(), x, y, z, ForgeDirection.UNKNOWN)) {
// TODO: 29/10/2019 Dar kick no player.
return;
}
TECarpentersFlowerPot TE = (TECarpentersFlowerPot) world.getTileEntity(x, y, z);
if (TE != null) {
if (hexColor != 16777215 && !TE.hasAttribute((byte) 24)) {
TE.addAttribute((byte) 24, new ItemStack(Items.dye, 1, 15));
if (!entityPlayer.capabilities.isCreativeMode && --entityPlayer.getCurrentEquippedItem().stackSize <= 0) {
entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null);
}
}
}
}
}
| 1,925 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinPacketHandler.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-CarpentersBlocks/src/main/java/io/github/crucible/grimoire/mixins/carpentersblocks/MixinPacketHandler.java | package io.github.crucible.grimoire.mixins.carpentersblocks;
import com.carpentersblocks.network.ICarpentersPacket;
import com.carpentersblocks.util.handler.PacketHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent;
import io.netty.buffer.ByteBufInputStream;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.NetHandlerPlayServer;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.io.IOException;
import java.util.List;
@Mixin(value = PacketHandler.class, remap = false)
public class MixinPacketHandler {
@Shadow
@Final
private static List<Class> packetCarrier;
/**
* @author juanmuscaria
* @reason Fix para o console spam hack.
*/
@SubscribeEvent
@Overwrite
public void onServerPacket(FMLNetworkEvent.ServerCustomPacketEvent event) throws IOException {
ByteBufInputStream bbis = new ByteBufInputStream(event.packet.payload());
EntityPlayer entityPlayer = ((NetHandlerPlayServer) event.handler).playerEntity;
int packetId = bbis.readInt();
if (packetId < 0 || packetId > packetCarrier.size()) {
((NetHandlerPlayServer) event.handler).kickPlayerFromServer("§4Auto-Kicked by System! [0x03]");
System.out.println("O jogador " + entityPlayer.getGameProfile() + " está possivelmente com hack!");
}
try {
ICarpentersPacket packetClass = (ICarpentersPacket) packetCarrier.get(packetId).newInstance();
packetClass.processData(entityPlayer, bbis);
} catch (Exception e) {
e.printStackTrace();
((NetHandlerPlayServer) event.handler).kickPlayerFromServer("§4Auto-Kicked by System! [0x03]");
System.out.println("O jogador " + entityPlayer.getGameProfile() + " está possivelmente com hack!");
}
bbis.close();
}
}
| 2,040 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileEntitySieveAutomatic.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-ExAtris/src/main/java/io/github/crucible/grimoire/mixins/exastris/MixinTileEntitySieveAutomatic.java | package io.github.crucible.grimoire.mixins.exastris;
import ExAstris.Block.TileEntity.TileEntitySieveAutomatic;
import ExAstris.Data.ModData;
import cofh.api.energy.EnergyStorage;
import cofh.api.energy.IEnergyHandler;
import cofh.lib.util.helpers.ItemHelper;
import exnihilo.registries.SieveRegistry;
import exnihilo.registries.helpers.SiftingResult;
import net.minecraft.block.Block;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.ArrayList;
import java.util.Iterator;
@Mixin(value = TileEntitySieveAutomatic.class)
public abstract class MixinTileEntitySieveAutomatic extends TileEntity implements IEnergyHandler, ISidedInventory {
@Shadow private float volume;
@Shadow public abstract float getEffectiveSpeed();
@Shadow public EnergyStorage storage;
@Shadow public abstract int getEffectiveEnergy();
@Shadow public TileEntitySieveAutomatic.SieveMode mode;
@Shadow public Block content;
@Shadow public int contentMeta;
@Shadow public abstract int getFortuneModifier();
@Shadow protected ItemStack[] inventory;
@Shadow private boolean particleMode;
@Shadow private boolean update;
/**
* @author EverNife
* @reason Disable the drop of items on the groud
* to prevent situations like this: https://cdn.discordapp.com/attachments/573598615939973128/830637998152351744/unknown.png
*/
@Overwrite(remap = false)
public void ProcessContents()
{
volume -= getEffectiveSpeed();
storage.extractEnergy(getEffectiveEnergy(), false);
if (volume <= 0)
{
mode = TileEntitySieveAutomatic.SieveMode.EMPTY;
//give rewards!
if (!worldObj.isRemote)
{
ArrayList<SiftingResult> rewards = SieveRegistry.getSiftingOutput(content, contentMeta);
if (rewards != null && rewards.size() > 0)
{
Iterator<SiftingResult> it = rewards.iterator();
while(it.hasNext())
{
SiftingResult reward = it.next();
int fortuneAmount;
if (ModData.sieveFortuneExtraRolls)
fortuneAmount = getFortuneModifier();
else
fortuneAmount = 1;
for (int fortuneCounter = 0; fortuneCounter < fortuneAmount; fortuneCounter++)
{
int size = getSizeInventory()-2;
int inventoryIndex = 0;
if (worldObj.rand.nextInt(reward.rarity) == 0)
{
int fortuneAmount2;
if (ModData.sieveFortuneExtraDrops)
fortuneAmount2=getFortuneModifier();
else
fortuneAmount2=1;
for (int fortuneCounter2 = 0; fortuneCounter2 < fortuneAmount2; fortuneCounter2++)
{
for(int i = 1; i < size; i++)
{
if(inventory[i] == null)
{
inventoryIndex=i;
break;
}
else
{
if (ItemHelper.itemsEqualWithMetadata(inventory[i],new ItemStack(reward.item, 1, reward.meta)) && inventory[i].stackSize < inventory[i].getMaxStackSize())
{
inventoryIndex=i;
break;
}
}
}
if(inventoryIndex != 0)
{
if (inventory[inventoryIndex] != null)
inventory[inventoryIndex] = new ItemStack(reward.item, (inventory[inventoryIndex].stackSize + 1), reward.meta);
else
inventory[inventoryIndex] = new ItemStack(reward.item, 1, reward.meta);
}
/* GRIMOIRE START
else
{
EntityItem entityitem = new EntityItem(worldObj, (double)xCoord + 0.5D, (double)yCoord + 1.5D, (double)zCoord + 0.5D, new ItemStack(reward.item, 1, reward.meta));
double f3 = 0.05F;
entityitem.motionX = worldObj.rand.nextGaussian() * f3;
entityitem.motionY = (0.2d);
entityitem.motionZ = worldObj.rand.nextGaussian() * f3;
worldObj.spawnEntityInWorld(entityitem);
}
GRIMOIRE END
*/
}
}
}
}
}
}
}
else
{
particleMode = true;
}
update = true;
}
}
| 5,934 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinTileItemDuct.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-ThermalDynamics/src/main/java/io/github/crucible/grimoire/mixins/thermaldynamics/MixinTileItemDuct.java | package io.github.crucible.grimoire.mixins.thermaldynamics;
import cofh.thermaldynamics.duct.item.ItemGrid;
import cofh.thermaldynamics.duct.item.TileItemDuct;
import cofh.thermaldynamics.multiblock.IMultiBlockRoute;
import cofh.thermaldynamics.multiblock.Route;
import cofh.thermaldynamics.multiblock.RouteCache;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(value = {TileItemDuct.class}, remap = false)
public abstract class MixinTileItemDuct implements IMultiBlockRoute{
@Shadow public abstract RouteCache getCache();
@Shadow public ItemGrid internalGrid;
/**
* @author EverNife
* @reason Somehow the ServoItem can tick on an ItemDuct that has no cached network.
*
* `cofh.thermaldynamics.duct.attachments.retriever.RetrieverItem.handleItemSending(RetrieverItem.java:156)
* ...
* cofh.thermaldynamics.duct.item.TileItemDuct.getCache(TileItemDuct.java:326)
* `
*
* This will try to prevent NPE
*/
@Overwrite
public Route getRoute(IMultiBlockRoute itemDuct) {
RouteCache routeCache = getCache();
if (routeCache != null){ ///Add null check to prevent NPE
for (Route outputRoute : routeCache.outputRoutes) {
if (outputRoute.endPoint == itemDuct
|| (outputRoute.endPoint.x() == itemDuct.x() && outputRoute.endPoint.y() == itemDuct.y() && outputRoute.endPoint.z() == itemDuct.z())) {
return outputRoute;
}
}
}
return null;
}
/**
* @author EverNife
* @reason Somehow the ServoItem can tick on an ItemDuct that has no cached network.
*
* This will try to prevent NPE
*/
@Overwrite
public RouteCache getCache(boolean urgent) {
return internalGrid == null ? null : //Add null check to prevent NPE
urgent ? internalGrid.getRoutesFromOutput(this) : internalGrid.getRoutesFromOutputNonUrgent(this);
}
}
| 2,064 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinToolHelper.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Avaritia/src/main/java/io/github/crucible/grimoire/mixins/avaritia/MixinToolHelper.java | package io.github.crucible.grimoire.mixins.avaritia;
import com.gamerforea.eventhelper.util.EventUtils;
import fox.spiteful.avaritia.items.tools.ToolHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = ToolHelper.class, remap = false)
public abstract class MixinToolHelper {
@Inject(method = "removeBlockWithDrops", at = @At("HEAD"), cancellable = true)
private static void removeBlockWithDropsCheck(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, CallbackInfo ci) {
if (EventUtils.cantBreak(player, x, y, z)) ci.cancel();
}
} | 1,063 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |
MixinLudicrousSword.java | /FileExtraction/Java_unseen/CrucibleMC_Grimoire-Mixins-1_7_10/Mixin-Avaritia/src/main/java/io/github/crucible/grimoire/mixins/avaritia/MixinLudicrousSword.java | package io.github.crucible.grimoire.mixins.avaritia;
import fox.spiteful.avaritia.items.tools.ItemSwordInfinity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = ItemSwordInfinity.class, remap = false)
public abstract class MixinLudicrousSword {
@Redirect(method = "func_77644_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;func_70645_a(Lnet/minecraft/util/DamageSource;)V"))
private void victimProxy(EntityLivingBase victim, DamageSource src) {
if (!victim.isDead && victim.getHealth() > 0)
victim.onDeath(src); // TODO: 17/10/2019 Nope, isso não funcionou, talvez agora funcione?
}
}
| 854 | Java | .java | CrucibleMC/Grimoire-Mixins-1.7.10 | 13 | 7 | 3 | 2019-11-30T22:53:46Z | 2023-04-23T21:30:00Z |